How to show Infomessage on SCTASK form, from a business rule insert from another table?

MarioP1
Tera Contributor

Hi Folks,

 

I have a business rule(custom table) that runs when a file is attached on SCTASK table.

 

I need to show an Infomessage to user on SCTASK form after the BR(custom table) runs successfully. The BR being on server side I am not sure how to show Infomessage on client side(SCTASK form) to user? I am able to update work notes from BR with comments but not able to show Infomessage or alert

 

Any ideas?

 

Please ask questions if I am not clear with my ask.

 

Thanks

 

 

6 REPLIES 6

SumanKumarM
Tera Contributor

Hello MarioP1,

If understand correctly, you want to display message when comments are updated. If So, Please write onChange client script on sc_task table and use g_form.addInfoMessge() to display the required conent. 

 

Please mark helpful, if it helps you kick starting implementation.

 

BR,

Suman.

Hello @SumanKumarM ,

Thanks for your input.

 

The work notes are auto updated through a Business rule from a custom table. It being a server side action, does not trigger onChange client script on sc_task table. I already tried it with no positive result.

 

Bert_c1
Kilo Patron

You can use:

 

 

gs.addInfoMessage('message to be displayed');

 

in the BR script. See:

 

https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/server_legacy/c_GlideSystemAPI#...

 

search for 'addInfoMessage'

TryciaK
Tera Contributor

Hi, it sounds like you're trying to display a client-side InfoMessage on the SCTASK form after a server-side Business Rule (BR) on a custom table executes when a file is attached. Since Business Rules run on the server side, they can't directly trigger client-side UI elements like InfoMessages.