Reputation: 473
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?
Upvotes: 0
Views: 1860
Reputation: 2069
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.
Upvotes: 4
Reputation: 8847
afterSubmit
does not fire when a record is deleted. You will need to use beforeSubmit
Upvotes: 4