can anyone confirm if adding a field to a record t...
# suitescript
u
can anyone confirm if adding a field to a record through a
beforeLoad
UserEvent will allow an
Advanced PDF Template
to detect and retrieve values from that same field? for context, i plan on adding a field using beforeLoad's context parameter to do
context.form.addField()
instead of creating a custom field for the specific record type. any and all input would be appreciated.
w
You can add a field on beforeLoad, but the value won't be stored anywhere if you plan to use it in the context EDIT. Unless you write a script in beforeSubmit that takes the value that the user has entered and stores it in another field. Advanced PDF will only have access to fields that are on the record or fields that are created and populated in beforeLoad. Usually for PDF, you specify the PRINT context if it is only needed for that type.
a
in the beforeLoad UE you're adding a field to the FORM the UI representation of a record, but NOT the RECORD itself.
u
“you specify the PRINT context if it is only needed for that type.” @Watz might I ask you to elaborate a bit further on this? I’m a bit lost as I cannot find any documentation pertaining to a print context for UserEvents. The closest I found is an article from 2022 talking about the Print button triggering UserEvent scripts: https://netsuiteful.com/2022/12/08/print-icon-will-trigger-user-event/.
w
It's exactly as your linked article shows in the first example. In the type = 'print', add a custpage-field that will be accessible in the advanced pdf template.