ANS-1641 · SUITESCRIPT DEVELOPMENT
Does nlapiSubmitField Trigger NetSuite Workflows? Understanding Event Types
Understand how NetSuite workflow event types, particularly 'Direct List Edit', determine if `nlapiSubmitField()` will activate a workflow.
Short answer
The activation of NetSuite workflows by `nlapiSubmitField()` depends on the workflow's Event Type. This function will only trigger workflows configured with the 'Direct List Edit' event type. Workflows set to 'Edit' will not be triggered by `nlapiSubmitField()`, but will respond to UI edits.
Scenario
NetSuite developers and administrators often need to programmatically update records using `nlapiSubmitField()`. A common question arises regarding whether such programmatic updates will activate existing workflows configured on the record. Understanding this interaction is crucial for ensuring proper business logic execution and avoiding unexpected behavior.
Solution
The activation of NetSuite workflows by nlapiSubmitField() is determined by the workflow's configured Event Type. This function specifically triggers workflows that have the 'Direct List Edit' event type enabled. It is important to note that these behaviors were observed with the workflow Trigger Type set to 'Before Record Submit'.The interaction between nlapiSubmitField() and different workflow Event Types can be summarized as follows:
- Event type: Edit
- Triggering the condition from the UI will trigger the workflow.
nlapiSubmitFieldwill NOT trigger the workflow.
- Event type: Direct List Edit
nlapiSubmitFieldwill trigger the workflow.- Triggering the condition from the UI will NOT trigger the workflow.
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
