current.setabortaction not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2025 12:17 AM
(function executeRule(current, previous /*null when async*/) {
var x = new GlideRecord('incident');
x.addQuery('parent_incident', current.sys_id);
x.query();
if(x.next()){
if(x.state=='7'){
gs.addInfoMessage('This is a child incident and the state is closed');
current.setAbortAction(false);
}
else{
gs.addErrorMessage('The child incident is not closed first close that');
current.setAbortAction(true);
}
}
// Add your code here
})(current, previous);
in this script the true part of the setabortaction is not working. the form gets updated even if it shows invalid update and the error message in the script. can anyone suggest any solution why this might be happening?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2025 12:38 AM
your business rule is on which table?
if it is going inside the error message then it should abort
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader