Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

gs.addInfoMessage or gs.addErrorMessage shows multiple Error message in Workspace

SomashekarB
Tera Contributor

Before BR rules run on insert or update is showing multiple error messages

(function executeRule(current, previous /*null when async*/) {
    var caseRecord = new GlideRecord('incident');
    caseRecord.get(current.table_sys_id);
    if (caseRecord.state == '7') {
        gs.flushMessages();
       gs.addInfoMessage('Attachments cannot be added or removed when the state is closed or resolved.');
        current.setAbortAction(true);
    }
})(current, previous);
 
 
SomashekarB_0-1731071955064.png

 

0 REPLIES 0