Hello all. I am adjusting ADVPDF for Bill of Mater...
# advancedpdf
a
Hello all. I am adjusting ADVPDF for Bill of Materials. I declared my item table as usual:
Copy code
<#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>
I want to pull from the item record, a custom field (custitem6). When I add the following line
<td colspan="2">${item.item.custitem6}</td>
the value for the custitem6 for the first item gets repeated for all items. instead of the following: ITEM Custitem6 A ABC123 B DEF456 C GHI789 its displays: ITEM Custitem6 A ABC123 B ABC123 C ABC123 Anyone know how to get around this? Thank you!!
n
I think if the
<td>
is within the loop, you could try
<td colspan="2">${item.custitem6}</td>
a
That does not bring anything in. Only way I have been able to populate is to put
item.item.custitem
This is the code:
Copy code
<#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="3" align="left">Qty. Required</th>
               <th colspan="8">${item.item@label}</th>
               <th colspan="8">${item.description@label}</th>
               <th colspan="2">Units</th>
              <th colspan="2">Test1</th>
               <th align="right" colspan="8">${item.inventorydetail@label}</th>
            </tr>
         </thead>
         </#if>
         <tr>
            <td align="center" colspan="3" line-height="150%">${item.quantity}</td>
            <td colspan="8"><span class="itemname">${item.item}</span></td>
            <td colspan="8">${item.description}</td>
            <td colspan="2">${item.units}</td>
           <td colspan="2">${item.custitem6}</td>
            <td align="right" colspan="8">${item.inventorydetail}</td>
         </tr>
         </#list><!-- end items -->
      </table>
      <hr />
      </#if><#if record.assemblydetail?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="3" align="left">Qty. Required</th>
               <th colspan="8">${item.item@label}</th>
               <th colspan="8">${item.description@label}</th>
               <th colspan="2">Units</th>
              <th colspan="2">Test2</th>
            </tr>
         </thead>
         </#if>
         <tr>
            <td align="center" colspan="3" line-height="150%">${item.custcol_bom_qty}</td>
            <td colspan="8"><span class="itemname">${item.item}</span></td>
            <td colspan="8">${item.description}</td>
            <td colspan="2">${item.units}</td>
           <td colspan="2">${item.custitem6}</td> 

         </tr>
         </#list><!-- end items -->
It is Test1 and Test2 column headers with item.custitem6. This produces n othing. item.item.custitem6 repeats the value for all items but is correct for the first one.
n
So, item, description and units all display correctly, but item.custitem6 does not.
a
Yes. That is because they all appear on the record. They are columns on the form. this custom field is not on the form and is not needed. I do not want to create a custom field to just pull it in. I want to join item table and this transaction and fetch the value.
n
Correct if Wrong: But my experience is you have to show the custom field as column on the item in order for it to pull in and be displayable on the template. You could try making it hidden/inline if you don't want it to appear on the form.
m
This is one of the biggest product defects related to advanced PDF templates. When creating such a field on the item record, NetSuite will repeat the first value for each line. I spent many days trying to fix that. The only way to work around this is to create a column field on line level and source the item field through it.
a
@Milcho Dimkov Thank you for the input. Do you know if there is an enhancement request surrounding this?
m
honestly, I haven't looked into this - my guess is that there is such a request filed but nobody would know when it will be fixed
m
@nathanw you are correct that if you hide the field on the form it will not be available for the template either. However, there is a hack/workaround that works a lot of the time. If you set the description of the field to a blank string, it will hide in the UI but still allow you to use it in the template
❤️ 1
a
@michoel Beautiful. Will give that a try!