Before User Submit Trigger
The Before User Submit trigger is a client trigger and executes after a user clicks Save on a record and before the Before Record Submit server trigger executes. Before User Submit is a client trigger because it occurs when the form is present in the browser.
The following diagram shows common record edit events and when the Before User Submit trigger executes:
Use this trigger to validate a record form before the Before Record Submit trigger executes. Using this trigger with the Return User Error action, instead of the Before Record Submit trigger, enables a user to return to the form to fix any field value before submitting the form to the NetSuite database. For a list of all the actions that support this trigger, see Workflow Triggers Quick Reference.
Before User Submit Trigger Example
The following screenshot shows a Return User Error action on the Before User Submit trigger that validates that the Repairs Complete checkbox is selected before the user saves the record:
If the user clicks Save on the record without selecting the Repairs Complete checkbox, NetSuite displays the error message. The user clicks OK and then selects the checkbox.
Before User Submit Trigger Guidelines
Use the following guidelines when using the Before User Submit trigger.
-
The Before Record Submit and Before User Submit triggers appear to be functionally similar. However, actions that use the Before Record Submit trigger execute on the server, whereas actions that use the Before User Submit trigger execute in the browser.
For example, a Return User Error on a Before Record Submit trigger would execute on the server. The user would return to the record and all previously entered data would be lost. If a Return User Error or Show Message action was used on a Before User Submit trigger instead, the user clicks OK on the message and continues editing the record with no loss of data.