- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2024 11:11 AM
We have a business rule that prevents a problem record from being resolved if there are open problem tasks. The business rule is working as expected, however, the error message is only displaying on the screen for like a second and then it goes away. Any suggestions on how we can fix this and get the error message to stick around?
(function executeRule(current, previous /*null when async*/ ) {
var OpenproblemTaskGr = new GlideRecord("problem_task");
OpenproblemTaskGr.addQuery("problem", current.sys_id);
OpenproblemTaskGr.addActiveQuery();
OpenproblemTaskGr.query();
if (OpenproblemTaskGr.next()) {
gs.addErrorMessage('This Problem cannot be resolved as there is or are active child Problem Tasks. Please close them first.');
current.problem_state = previous.problem_state;
current.state = previous.state;
current.setAbortAction(true); //abort the record
gs.setRedirect(current);
}
})(current, previous);
Solved! Go to Solution.
- Labels:
-
Problem Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2024 11:02 AM
Hi Zach, I was looking through business rules, client scripts, and UI policies and I found an old UI policy that we are no longer using but it was active and the execute if false was clearing messages. Once I inactivated this, the error message was staying! Thanks for the suggestion to look at other scripts/rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2024 11:02 AM
Hi Zach, I was looking through business rules, client scripts, and UI policies and I found an old UI policy that we are no longer using but it was active and the execute if false was clearing messages. Once I inactivated this, the error message was staying! Thanks for the suggestion to look at other scripts/rules.