Arman K
05/11/2024, 11:59 AMhieu-ng
05/12/2024, 7:23 PMconst beforeLoad = (scriptContext) => {
try {
if (scriptContext.type !== scriptContext.UserEventType.PRINT) return;
const {newRecord, form} = scriptContext;
const linesField = form.addField({
id: "custpage_custom_lines",
label: 'Custom Lines',
type: ui.FieldType.INLINEHTML,
})
const searchResults = // create a function to get search results
linesField.defaultValue = JSON.stringify(searchResults)
} catch (error) {
log.error('ERROR in beforeLoad', error.toString());
}
}
You could get the custom lines in the pdf as follows:
<#assign data = record.custpage_custom_lines?eval>
<#list data as line>//doSomething</#list>
You might only be able to use this in the body of the pdf template. If you need to use this in head then I think you could inject a Suitelet in the head then use it