I have a client that wants to combine items into a...
# advancedpdf
r
I have a client that wants to combine items into a single line on the invoice PDF. Is that doable? We are still in config so I can set up the items and lines as needed. I just need to know if I can use a matching value to create a single line on the PDF. Let me know if more details would be helpful.
s
@Rebecca it definitely is possible to manipulate multiple lines into one on the PDF, though wherever possible it’s good to try and keep the raw record and the presentation version (the PDF) as similar as possible to avoid confusion. Also, the more custom manipulation done in the PDF, the harder it may be to maintain that in the future. Just something to consider. You’ll want to take a look at Freemarker variables, as that will probably be needed for matching and combining multiple lines into one.
👍 1
b
In before load you can check that the context.type == 'print' and that context.newRecord.id exists and load the record and create an array of objects with your combined data and write it to a custom field. You can then access in the Advanced PDF, check if the field ?has_content and then assign a variable to the feild?eval and use a list to loop through array of objects
💯 1
👍 1
l
you can insert an INCLUDE tag in freemarker that points to a suitelet which returns what ever manipulation you like to achieve