'How to do something during the "Delete" user event on NetSuite?
I've tried this:
if (context.type == context.UserEventType.DELETE) {
log.debug('afterSubmit', 'afterSubmit');
}
But in vain, the record just be deleted and no execution log appears. How to do something during the "Delete" user event?
Solution 1:[1]
afterSubmit does not fire when a record is deleted. You will need to use beforeSubmit
Solution 2:[2]
How is the record being deleted? I mean using UserInterface, UserEvent or Map/Reduce etc. Since, as per NetSuite User-Event is not emitted from another UserEvent.
That being said, if record is deleted from UserEvent of some other script, you won't get UserEvent of deleted record.
Although you can try using Workflow action scripts and set its Contexts to UserEvents.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | erictgrubaugh |
| Solution 2 |
