Cory Weiner
05/13/2024, 5:20 PMhieu-ng
05/13/2024, 5:57 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 ithieu-ng
05/13/2024, 5:58 PMCory Weiner
05/13/2024, 6:10 PMStefan Reeder
05/13/2024, 10:51 PMhieu-ng
05/14/2024, 2:28 PMNElliott
05/14/2024, 2:55 PMhieu-ng
05/14/2024, 3:02 PMStefan Reeder
05/14/2024, 10:40 PMStefan Reeder
05/14/2024, 10:42 PMhieu-ng
05/14/2024, 10:44 PMStefan Reeder
05/14/2024, 10:48 PMNElliott
05/15/2024, 7:11 AMStefan Reeder
05/15/2024, 9:35 AMNElliott
05/15/2024, 9:37 AM