Hey I am simply getting some fields of item record...
# advancedpdf
s
Hey I am simply getting some fields of item record on purchase order advance pdf template using item.item.fieldId. But it is printing only same first value in loop. Can anyone has idea how to get values from item record. I have also change record.item as tranline and get value by assigning it to value on template but nothing helps. tranline.item.upccode upccode field and another custom field I want to print.
Copy code
<table class="itemtable" style="width: 100%;"><!-- start items --><#list record.item as tranline>
<#assign upccode = tranline.item.upccode>
<#if tranline_index==0>
<thead>
	<tr>
	<th align="left" colspan="3" style="width: 60px;">${tranline.item@label}</th>
	<th align="center" colspan="5" style="width: 100px;">UPC Code</th>
	<th align="left" colspan="4" style="width: 80px;">Vendor#</th>
	<th align="center" colspan="12" style="width: 270px;">${tranline.description@label}</th>
	<th align="center" colspan="4" style="width: 70px;">${tranline.quantity@label}</th>
	<th align="right" colspan="4" style="width: 70px;">Price</th>
	<th align="right" colspan="6" style="width: 80px;">${tranline.amount@label}</th>
	</tr>
</thead>
</#if><tr>
	<td align="left" colspan="3" style="width: 40px;">${tranline.item}</td>
	<td align="left" colspan="5" style="width: 100px;">${upccode}</td>
	<td align="left" colspan="4" style="width: 80px;">${tranline.vendorname}</td>
	<td align="left" colspan="12" style="width: 270px;">${tranline.description}</td>
	<td align="right" colspan="4" style="width: 70px;">${tranline.quantity}</td>
	<td align="right" colspan="4" style="width: 70px;">${tranline.rate}</td>
	<td align="right" colspan="6" style="width: 80px;">${tranline.amount}</td>
	</tr>
	</#list><!-- end items --></table>
s
The model does not load the item record for each line item, so you can’t directly get other fields from the item record like this (using tranline.item.field). The usual work around is to create Transaction Line formula fields, then use Sourcing & Filtering to source fields from the Item. You can then reference the formula fields in the template. Make sure Store Value is not checked on the formula fields.
👍 1
s
Thank you so much.