Hi everyone. I'm seeing a strange behavior on addi...
# advancedpdf
a
Hi everyone. I'm seeing a strange behavior on adding a field to a custom Packing Slip. I have a transaction line field that is set to not store value. The field itself is a string concatenation of several other transaction line fields, of which all of those fields are applied to Item Fulfillments and Sales orders. This field is applied to Item Fulfillments and Sales orders and renders appropriately on each of those transaction forms. In the pack slip, there is a table that references the item table of the sales order like so:
Copy code
<#if salesorder.item?has_content>

<table class="itemtable" style="width: 100%; margin-top: 10px;">
<thead>
	<tr>
	<th colspan="12">${salesorder.item[0].item@label}</th>
	<th colspan="3">${salesorder.item[0].options@label}</th>
	<th align="right" colspan="4">${salesorder.item[0].quantityordered@label}</th>
	<th align="right" colspan="4">Size</th>
	<th align="right" colspan="4">${salesorder.item[0].quantity@label}</th>
	</tr>
</thead>
<#list salesorder.item as tranline><tr>
	<td colspan="12"><span class="itemname">${tranline.item}</span><br />${tranline.description}</td>
	<td colspan="3">${tranline.options}</td>
	<td align="right" colspan="4">${tranline.quantityordered}</td>
	<td align="right" colspan="4">${tranline.custcol_graft_assigned_sizing</td>
	<td align="right" colspan="4">${tranline.quantity}</td>
	</tr>
	</#list></table></#if>
The "${tranline.custcol_graft_assigned_sizing}" field, when placed in this table, returns an error on one of the fields that the field is referencing (ERROR: Field 'custcol_donor_att_val_1' Not Found), but that custom transaction line field does exist on the record. Is this a limitation of reference only fields being rendered on advanced PDF templates?
t
Can you make a custom field (stored value) that is sourced from this field via workflow?
a
I could do that, do you know if that would be possible to keep that field in sync with the referenced field?
t
Set the workflow after record submit? That way if the record is edited and custcol_graft_assigned_sizing changes, your custom field will change?
👍 1
a
Good suggestion, I'll give that a shot!
t
Either that or just concat all of the fields that custcol_graft_assigned_sizing represents.
a
Those fields are also reference fields, so I'm thinking your suggestion is a good one to have a stored field value.
☝️ 1
s
make sure the fields you are referencing are all shown on the transaction form... hidden or not shown are not exposed to Advanced PDF. this includes fields referenced by your non-stored custom field
non-stored fields are fine. If you can see them in the UI, you can use them
t
@amoreng Did you get this to work?
a
I have not gotten it to work yet. I verified that all fields used in the calculation of the custcol_graft_assigned_sizing field are available to both the sales order and the item fulfullment. The itemtable is populated via the salesorder.item object, so I believe this is reading from the sales order not the item fulfillment, but in the UI of the sales order (and the transaction line column) the field is marked accessible to the item fulfillment.