0

I have a scenario with a Multi-select field on an Invoice which includes 1 or more "Related Item Fulfillments".

With an Invoice advanced PDF, displaying the ${record.custbody_linkedif} will show something akin to:

**Related IF:** Item Fulfillment #DSO10044268 Item Fulfillment #DSO10044268-1

What i want to know, is there a way to access the data on the linked fulfillments within the Advanced PDF.

I have tried:

<#list record.custbody_linkedif as linkedIF>
  <p>Related IF: ${linkedIF.tranid}</p>
</#list>

but that results in an error:

For "#list" list source: Expected a sequence or collection, but this has evaluated to a hash+string (wrapper: com.netledger.templates.model.StringModel):
==> record.linkedIF [in template "template" at line 253, column 14]
----
FTL stack trace ("~" means nesting-related):
- Failed at: #list record.linkedIF... [in template "template" at line 253, column 7]
----
Steve Reeder
  • 980
  • 16
  • 42
  • As it's a hash, maybe printing what keys it has can help. So try what `${record.custbody_linkedif?keys?join(", ")}` prints. Le's say it has a `items` key (I don't know), then next you can try `#list record.custbody_linkedif.items` (again, this is just an example, I don't know if it has `items`). – ddekany Nov 24 '19 at 14:55
  • Still gets an error - expected Extended Hash, but got a hash+string:::: For "?keys" left-hand operand: Expected an extended hash, but this has evaluated to a hash+string (wrapper: com.netledger.templates.model.StringModel): ==> record.custbody_linkedif [in template "template" at line 225, column 7] ---- FTL stack trace ("~" means nesting-related): - Failed at: ${record.custbody_iif_itemfulfillment... [in template "template" at line 225, column 5] – Steve Reeder Nov 25 '19 at 04:18
  • Yeah, non-extended hashes don't support listing their keys. You should check in the Java code what keys that object expose through `TemplateHashModel.get(String)`. (If it's not documented anywhere, that is.) – ddekany Nov 25 '19 at 20:43

0 Answers0