Advanced Pdf: Unable to get Item record values using sales order line

Hi,

In this post, we are going to discuss about issue related to Advanced PDF

If you are newbie, read below post about Advanced PDFs:

Read about Advanced PDF 

Arithmetic in Advanced PDF

Lets come back to our topic for this post, as you know we can access fields from related records using join. We can only access records from field which are either sublists or drop down fields. Example: you can access customer record's field using ${record.entity.fieldFromCustomer} easily, where fieldFromCustomer is field on customer record. This logic works great for body fields however if you try same to access line level joins, it will fail and show you values from last line. 

Example: Lets say you have custom field custitem_abc and want to show it in PDF under sublist section. 

Typically developer write below code to access line item :

<#list record.item as item>

${item.item}

${item.quantity}

</#list>

If we try to use ${item.item.custitem_abc}same way, this piece of code will only show value from sublist's last item record.

Solution:

As we can only access body fields using joins, it is not advisable to use  ${item.item.custitem_abc} to get value from item records.

Instead, create Line Item Fields ( custcol_abc) and source value from item record to line item fields, Keep field type same.

This way when ever you add line on transaction record , values from item record will be source to line item. Use ${item.custcol_abc} to get values. 

** Please Note: Sourcing does not work if you copy any record, or edit any record. You can use user event script to overcome this limit.

 

I hope, this will help you. You might have better way of doing this, please share with us in comment. Lets us know about your thoughts.

 

Thanks

Netsuite Guru


Download Netsuite Guru Android App
Follow Me on Linkedin
Our FB Page

Comments