- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:24 AM
I am having a requirement problem should not be closed until all the problem tasks are closed. i am able to achieve the requirement with below business rule , But the problem is form is showing the closed state until is manually reload it . I want form to reload automatically and set back to resolved state .
Please help me on it
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:31 AM
if it's aborted then you cannot reload it
try this
(function executeRule(current, previous /*null when async*/ ) {
var Ptaskgr = new GlideRecord('problem_task');
Ptaskgr.addQuery('state', '!=', 157);
Ptaskgr.addQuery('problem', current.sys_id);
Ptaskgr.query();
if (Ptaskgr.next()) {
gs.addInfoMessage('Please close the related Problem tasks first.');
current.state = previous.state;
current.setAbortAction(true);
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:28 AM
Would you mind closing your earlier questions by marking appropriate response as correct?
Members have invested their time and efforts in helping you.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 06:31 AM
if it's aborted then you cannot reload it
try this
(function executeRule(current, previous /*null when async*/ ) {
var Ptaskgr = new GlideRecord('problem_task');
Ptaskgr.addQuery('state', '!=', 157);
Ptaskgr.addQuery('problem', current.sys_id);
Ptaskgr.query();
if (Ptaskgr.next()) {
gs.addInfoMessage('Please close the related Problem tasks first.');
current.state = previous.state;
current.setAbortAction(true);
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2025 12:11 AM
is it sloved now?