To display child record information within the printed PDF of a parent custom record, follow this approach using SuiteScript and Advanced PDF/HTML templates:
Steps to Implement
- Deploy a User Event Script on the Parent Custom Record
- Within the beforeLoad function, ensure the script executes only when the context is CONTEXT.PRINT.
- Generate a Virtual Sublist with Child Record Data
- Inside the script, dynamically create a virtual (non-persistent) sublist using form.addSublist(…). Then, fetch related child record entries using search and set the values to the sublist.
- Access the Virtual Sublist in the PDF Template
- In the Advanced PDF/HTML template linked to the parent record, loop through the virtual sublist (<#list record.line as line>) and display the values in PDF. Use the sublist fields to present child record data in the desired format.