The execution context of user-event script is affected by CSV Import preference.
Using Administrator role navigate to Setup > Import/Export > CSV Import Preferences, check setting for "Run Server SuiteScript and Trigger Workflows".
If this preference is enabled (checked), then user-eventscript is triggered and all three events (
afterSubmit) are executed and thecontext is
If the preference is disabled, the user-event script gets alsotriggered, but performs only actions defined in the
beforeLoadfunction - and with context