We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

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

SomashekarB6490
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