jen
11/18/2020, 7:54 PM<#include>
that document in a template? The document is XML. My field is called custbody_adf
.
If I simply print out the value of the field in the template, it shows up as a hyperlink in the PDF (underlined, clickable), so I have confirmed that the template, in theory, knows the URL of that file.
e.g. <p>custbody_adf is ${custbody_adf}</p>
When I tried <#include "${record.custbody_adf}"/>
though, I get an error when I try to print using the template.
The only solution seems to be to have a separate field (custbody_adf_url
) that stores the URL of the file, and even then I have to split it up because the <#include>
doesn’t work when you are including a variable that has ampersands in it....
Right now I have this, which is overly cumbersome and also I really don’t want to have to have a separate field just to be able to get the URL of the file.
<!-- Split the adf_url in the main URL and the arguments -->
<#assign adf_url_first_split = record.custbody_adf_url?split("?")/>
<!-- The arguments -->
<#assign adf_url_arguments = adf_url_first_split[1]/>
<!-- Split the arguments on their ampersands -->
<#assign adf_url_argument_split = adf_url_arguments?split("&")/>
<!-- The arguments -->
<#assign adf_url_id_argument = adf_url_argument_split[0]/>
<#assign adf_url_c_argument = adf_url_argument_split[1]/>
<#assign adf_url_h_argument = adf_url_argument_split[2]/>
<#assign adf_url_xt_argument = adf_url_argument_split[3]/>
<!-- Split each argument on the equals sign. -->
<#assign adf_url_id_split = adf_url_id_argument?split("=")/>
<#assign adf_url_c_split = adf_url_c_argument?split("=")/>
<#assign adf_url_h_split = adf_url_h_argument?split("=")/>
<#assign adf_url_xt_split = adf_url_xt_argument?split("=")/>
<!-- The value for the arguments -->
<#assign adf_url_id_value = adf_url_id_split[1]/>
<#assign adf_url_c_value = adf_url_c_split[1]/>
<#assign adf_url_h_value = adf_url_h_split[1]/>
<#assign adf_url_xt_value = adf_url_xt_split[1]/>
<#include "<https://XXXXXX.app.netsuite.com/core/media/media.nl?id=${adf_url_id_value}&c=${adf_url_c_value}&h=${adf_url_h_value}&_xt=${adf_url_xt_value}>"/>
creece
11/18/2020, 8:01 PMcreece
11/18/2020, 8:04 PMjen
11/18/2020, 8:26 PMjen
11/18/2020, 8:27 PM<#include>
the content of the filejen
11/18/2020, 8:28 PM<#include>
the explicit path to the file, but I need to get that dynamically from the field on the transaction (as the file is different for each tx)creece
11/19/2020, 5:16 AMjen
11/19/2020, 6:43 PM