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.addErrormessage is popping on form

sowmyaj
Giga Expert

Hi All,

        In the advance script of BR I have added

                  gs.addErrorMessage('xyz.');

                  current.setAbortAction(true);

                  current.state = previous.state;

The above message is just flashing on the form and disappears. I want to make the message to be visible to the user. how can I do?

Thanks,

Sowmya.

15 REPLIES 15

tanumoy
Tera Guru

It should not disappear. Please open the form in new tab/window and try once.


Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Must be something else running as well. I did a quick test to verify on my personal dev and it worked there. As a before BR.



//Göran


Akash4
Kilo Sage

Hi Sowmya,



Use getErrorMessages() and capture the gs.addErrorMessage('xyz.');


Then save in a new variable and give the same in addInfoMessage();



Hope this could help you.



-Akash


Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.

BALAJI40
Mega Sage

current.state = previous.state;


gs.addErrorMessage('xyz.');


current.setAbortAction(true);



Now try, When ever user cancels only the message box will remove.