- User event scripts cannot be executed by other user event scripts or by workflows with a Context of User Event Script. In other words, you cannot chain user event scripts. You can, however, execute a user event script from a call within a scheduled script, a portlet script, or a Suitelet.
- User event scripts are executed based on operations defined as beforeLoad, beforeSubmit, and afterSubmit.
There are 3 Entry points are there in User Event Scripts, Which are :
1. beforeLoad :
- The client sends a read operation request for record data. This request can be generated from the user interface, SOAP web services, REST web services, CSV import, or server SuiteScript (except other user event scripts).
- Upon receiving the request, the application server performs basic permission checks on the client.
- The database loads the requested information into the application server for processing. This is where the beforeLoad operation occurs – before the requested data is returned to the client.
- The client receives the now validated/processed beforeLoad data.
2.beforeSubmit and afterSubmit
- The client performs a write operation by submitting data to the application server. This request can be generated from the user interface, SOAP web services, REST web services, server SuiteScript calls, CSV imports, or XML. The application server:
- performs basic permission checks on the client
- processes the submitted data and performs specified validation checks during a beforeSubmit operationThe submitted data has NOT yet been committed to the database.
- After the data has been validated, it is committed to the database.
- If this (newly committed) data is then called by an afterSubmit operation, the data is taken from the database and is sent to the application server for additional processing. Examples of afterSubmit operations on data that are already committed to the database include, but are not limited to:
- sending email notifications (regarding the data that was committed to the database)
- creating child records (based on the data that was committed to the database)
- assigning tasks to employees (based on data that was committed to the database)
- Asynchronous afterSubmit user events are only supported during webstore checko