SetAbortAction(true) shows Invalid Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2014 05:27 AM
Hi All,
I have created a before delete BR that sets the active field of the record as false and then aborts the delete action.
Below is the script for the BR and the delete UI Action.
try {
current.active = false;
current.update();
gs.addInfoMessage('DLA Request Item record deleted successfully.');
current.setAbortAction(true);
}
catch(error) {
gs.log('Error: Change Request Soft Delete for CMDB - ' + error);
}
Delete UI Action :-
current.deleteRecord();
On click of the Delete button it sets the active field as false but also shows a "Invalid update" error message.
Please help me find the root cause and resolution so that this "Invalid update" error message doesnot pop up on click of delete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2014 05:47 AM
Hi Neha,
The setAbortAction(true); command will result in invalid update statement which is stopping the current operation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2014 05:50 AM
You can try some tips mentioned here, but all in all, you cant avoid the message or need to have another one.
https://community.servicenow.com/message/684192#684192