your experience sounds like mine. do you mind shar...
# advancedpdf
m
your experience sounds like mine. do you mind sharing your workaround? we had custom print code already setup so it wasn’t terrible to build our version, but if i could stick with a ‘standard’ template my admins would certainly appreciate it.
a
So, my challenge was to consolidate all lines on an invoice group PDF to sum up all quantities and amounts according to the item descriptions on the invoices
The issue was that I couldn't bring in the Item Description (Memo) from the transaction lines to use as the group-by
So, I created a custom Invoice Group field (in Other Record fields) and drove that from a summary search leveraging the NS_CONCAT function to create basically a JSON string of Item.Name1Item.Desc1,Item.Name2Item.Desc2
😀 1
then I split that apart in the PDF code
the other key is to pre-sort the invoice detail list by Item, so all like items are together in the array - this allows you to basically get around the immutability of hashes in freemarker, so you can just use a couple global vars to detect a change in the item within the loop and print out the summarized row
m
Ah! NS_CONCAT! super smart! that’s essentially the exact situation we’re in, but i have a number of other line fields with disparate values. i’ll do some napkin math and see how many field/searchs that’d be and offer the option to the admins. thanks!
a
yep yep, good luck!
the revelation for me was that even though the field is non-stored, you can still read it in the advanced pdf
so random what NS allows you to do w/ those fields
d
will just add quickly here that not only can advanced PDF read non-stored fields, it can also read UE-added fields (like
custpage_field_added_by_ue_script
)
m
the more you know
(i did not know that! that’s awesome.)
the more you know 1
a
I did not know that either, good to know!