what is the difference between onRecordLoad and on...
# general
l
what is the difference between onRecordLoad and onRecordSubmit?
b
its the difference between viewing a record and saving it
beforeLoad happens when the record is loaded, which can be for views and edits in the ui, or from things like loading the record in suitescript
beforeSubmit occurs when a record is saved, its the step before the record is saved to NetSuite's database
notably, the save can be prevented by throwing errors
you can lookup the "How User Events are Executed" help topic for more information
l
@battk Thank you. One more question: How do i specify beforeSubmit in a suitescript?
b
this is a question where 1 or 2 matters a lot
for 1 you define a global function and set that function's name on the script record's before submit function field
for 2, the callback function you pass to the define function must return an object with the beforeSubmit property set to your before submit function
I heavily recommend reading up on user event scripts in NetSuite's help. Bad User Event scripts are one of the easiest ways to cause errors
l
Thank you so much