Error message only displaying for a second and then goes away

Aaron Struphar
Kilo Guru

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?

 

AaronStruphar_1-1732215918605.png

 

AaronStruphar_2-1732215951831.png

 

 

(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);

 

 

1 ACCEPTED SOLUTION

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.

View solution in original post

5 REPLIES 5

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.