User Event Script AfterSubmit-contexts (SuiteScript 2.x) || context.UserEventType

Defines the function that is executed after a record is submitted. The afterSubmit operation is useful for performing any actions that need to occur following a write operation on a record. Examples of these actions include email notification, browser redirect, creation of dependent records, and synchronization with an external system. Notes: The approve, cancel, and… Continue reading User Event Script AfterSubmit-contexts (SuiteScript 2.x) || context.UserEventType

Userevnt ScriptContext.type || context.UserEventType

Enum Description: Holds the string values for user event execution contexts. The beforeLoad, beforeSubmit, and afterSubmit entry points include the context.type parameter that takes on one of the enum values. Note: JavaScript does not include an enumeration type. The SuiteScript 2.x documentation utilizes the term enumeration (or enum) to describe the following: a plain JavaScript object with a… Continue reading Userevnt ScriptContext.type || context.UserEventType

runtime.ContextType

Holds the execution context values for script triggers Supported script types – Client & Server side scripts Module – N/runtime module //Add additional code … if (runtime.executionContext !== runtime.ContextType.USEREVENT) return; … //Add additional code