source item values from advance pdf template
# ask-stanley-ai
s
source item values from advance pdf template
c
AI generated answer (using internal Slack threads):
To source item values from an advanced PDF template in NetSuite, you can use the FreeMarker syntax. This syntax allows you to access the field values and item sublist values directly in the Advanced PDF without resorting to replicating it all in fields using JSON. Here is an example of how you can access the item sublist in an advanced PDF template:
Copy code
xml
<#if record.item?has_content>
<table class="itemtable" style="width: 100%; margin-top: 10px;">
<!-- start items -->
<#list record.item as item>
<#if item_index==0>
<thead>
<tr>
<th colspan="4">${item.item@label}</th>
<th>${item.options@label}</th>
<th>${item.quantity@label}</th>
<th>${item.units@label}</th>
<th>${item.quantitycommitted@label}</th>
</tr>
</thead>
</#if>
<tr>
<td colspan="4"><span class="itemname">${item.item}</span><br />${item.description}</td>
<td>${item.options}</td>
<td>${item.quantity}</td>
<td>${item.units}</td>
<td>${item.quantitycommitted}</td>
</tr>
</#list>
<!-- end items -->
</table>
</#if>
In this example,
record.item
is the sublist and
item.item
,
item.options
,
item.quantity
,
item.units
, and
item.quantitycommitted
are the fields in the sublist. The
?has_content
checks if the sublist has any items, and the
#list
directive is used to iterate over the items in the sublist. Remember, the print template is associated with the record. When you print a record, NetSuite automatically uses the associated print template and fills in the field values. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.822510898
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817093134
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.812475204
Please provide your feedback on this answer.