How do I list out the keys of say the “record” att...
# advancedpdf
e
How do I list out the keys of say the “record” attribute or all objects available to me in an Advanced PDF? For example, on a Vendor Payment template I know there are record.credit and record.apply objects, but I do not know all of the fields available within those objects. A simple “list” doesn’t work because it’s a string+hash
For "#list" list source: Expected a sequence or collection, but this has evaluated to a hash+string (wrapper: com.netledger.templates.model.StringModel):
d
e
tried like a thousand times, no go.
e
Yes! That is a very important article, on the way… but that only deals with top level data model keys. Thank you @michoel. The problem we’re interested in solving is one layer down from there - in the
record
object. And I cannot call
record?keys
because of the following error:
Copy code
For "?keys" left-hand operand: Expected an extended hash, but this has evaluated to a hash+string (wrapper: com.netledger.templates.model.StringModel):
==> record [in template "template" at line 145, column 25]
@David B the errors I get are: for `<#list record as key, value>`:
Copy code
For "#list" list source: Expected an extended hash, but this has evaluated to a hash+string (wrapper: com.netledger.templates.model.StringModel):
==> record [in template "template" at line 175, column 16]
for `<#list record as key>`:
Copy code
For "#list" list source: Expected a sequence or collection, but this has evaluated to a hash+string (wrapper: com.netledger.templates.model.StringModel):
==> record [in template "template" at line 175, column 16]
👍 1
👀 1