Morris S
Morris S

Reputation: 2604

NetSuite Advanced PDF (Freemarker) source JSON from record and display values

In NetSuite Advanced PDF source JSON array of objects from custom field on Item fulfillment record and iterate and display the values on the PDF.

Assigning the JSON does not work. <#assign array = tranline.custcol_my_custom_if_field>

Upvotes: 0

Views: 596

Answers (1)

Morris S
Morris S

Reputation: 2604

I found that to use assign will need to explicitly say its a string then eval to evaluate to an array, the solution is to add ?string?eval then we can iterate over the objects in the array and display the param values.

JSON field:

[{"displayField1": "apple", "displayField2": "green"},{"displayField1": "apple", "displayField2": "red"}]

Advanced PDF:

  <#assign array = tranline.custcol_my_custom_if_field?string?eval>
     <#list array as key>
       ${key.displayField1} - ${key.displayField2}
     </#list>

Upvotes: 0

Related Questions