How to clear Messages on a Business Rule

Meloper
Kilo Sage

i tried:

gs.clearOutputMessages();

and

gs.clearMessages();

but it does not work

1 ACCEPTED SOLUTION

BALAJI40
Mega Sage

Hi,

Clear/hide messages will work only on the client side.

or you can try with the flush message on the server-side.

find_real_file.png

 

View solution in original post

14 REPLIES 14

No, i added the Message in the UI Action (as mentioned) BR was only an example for the Serverside Question

@Meloper 

can you share your UI action script and UI action configuration image?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Meloper 

If the UI action is server side then the script will run for all the records selected

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ankur 😉 last try 🙂

if i select 11 Approvals.

the ui actions runs for every single Record..

So it shows 11 times the Error Message, because for every Record the UI checks if more than 10 are selected.

 

I only want to know, how to clear the Messeages out of a server side script.

So that the last Record, executed and checked by the ui action should show the Message. because all other Messages are cleared

Hi,

can you try this

gs.flushMessages();

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader