Skip to main content
October 15, 2023
Question

Docx merge field

  • October 15, 2023
  • 2 replies
  • 0 views

Hello 

How to pass the Values of the local variables to the Docx???? 

 

a!localVariables(
  local!data:ri!DocData,
  local!name:rule!SKJ_GetCustomerByAcc(AccountNum:ri!Number),
  local!resonDes:ri!resDes,


  /*to collect the data*/
  concat(
    /*Parent */
    "",

    /*Name*/
    "",
    local!name['recordType!{a0871cca-bd3d-4d03-b9ce-d1652bfa9dc0}SKJ Customer.fields.{b06eb39c-bf2f-4bb4-b283-cdbb894e406d}name'],
    "",

    /*Reson Des*/

    "",
    local!resonDes,
    "",


    "",
    datetext(now(),"yyyy/MM/dd"),
    "",


    /*for each*/

    a!forEach(
      items: local!data,
      expression: ""





    ),

    "",
  ),



)
  
  
  
  

    2 replies

    October 15, 2023

    Nevemind i fixed it. 

    but how do i pass these variables , that are not defined inside the Foreach: 

    They are not supposed to be in the Tabel:

    "<name>",
    local!name['recordType!{a0871cca-bd3d-4d03-b9ce-d1652bfa9dc0}SKJ Customer.fields.{b06eb39c-bf2f-4bb4-b283-cdbb894e406d}name'],
    "</name>",

    /*Reson Des*/

    "<Reson>",
    local!resonDes,
    "</Reson>",


    "<date>",
    datetext(now(),"yyyy/MM/dd"),
    "</date>",


    October 16, 2023

    What should i write in  the Docx , for the Customer's name for example, cause when i simply add merge field «${d.@namee}» 

    It returns an error in the template

    Hope someone helps