Error and Info Message immediately disappear

midaswa
Tera Contributor

Just upgraded from Quebec to San Diego
This Business Rule attached to the Change_Request

(function executeRule(current, previous /*null when async*/ ) {

    var ctask = new GlideRecord('change_task');
    ctask.addQuery('change_request', current.sys_id);
    ctask.query();
    if (!ctask.next()) {
        gs.addErrorMessage("Your implementation plan requires at least one Change Task.");
       current.state = 1;
      current.approval = 'not requested';
    }
})(current, previous);

Until now this left the error or warning message visible, after the upgrade it immediately disappears. I am sure it's to do with the page refresh function, sometime the UI will diver elsewhere and the Error message remains.

Messages also immediately disa[ppear if I use either or both:

    gs.addInfoMessage("Information");

    current.setAbortAction(true);

The system message timeout is set to 5, made no difference setting it to 0 or 200.

Tried terminating the above script with each of these, made no difference.

gs.setRedirect(current); 
action.setReturnURL(current);

I have checked that non of the other Business_Rules attached to the Change_Request have a gs.flushMessages();

Can anyone advise what is causing this or how I can track down the error? Attached image shows the message appearing, it immediately goes away on the Change Record (no matter from which Business Rule that I set it). 

3 REPLIES 3

midaswa
Tera Contributor

It was a client side script calling g_form.clearMessages(); activated on the Change_Request form reload. Working correctly now.

 

Ashley
Kilo Sage

Hello,

 

Could you please provide the name of the system property? I can't seem to find it myself to update as the infomessage timer is pretty short.

 

Kind Regards

Ashley