Hi,
I have a need to get multiple rows from custom record to invoice layout.
I think there is no link between original NetSuite invoice record and child subrecord in Advanced PDF template tool.
I have created custom field to Invoice where i have wanted data as JSON object.
I read data from the field to variable in PDF template.
<#assign dataToPrint= record.custbody_gs_field1 />
<td align="left" colspan="5">${dataToPrint}</td>
-> I can print the whole object to layout but can't access to key / value pairs.
Problem is accessing data in variable to print values to PDF.
I tried to convert variable with ?js_string and then ?eval but no success.
If you define local variable like this :
<#assign dataToPrintTest = "[{"col0": "10", "col1": "11"}]">
<#assign customrecord3 = dataToPrintTest?eval>
Set fieldvalue : <td align="left" colspan="5">${customrecord3[0].col0}</td>
This works correctly, i'm having value 10 in invoice print.
So the problem is getting data from NetSuite custom field, type is long text and contains data :
| [{"col0":"10","col1":"12"}] |
Has anyone done anything like this ?
Vesku