The CreatorCon Call for Content is officially open! Get started here.

How can I send alert message to the user by using script include or business rule?

sudharsanv36
Kilo Guru

I am new to Service Now, can anyone please help me with the above question.

1 ACCEPTED SOLUTION

Since business rules run server side and the alert function is processed client side, I do not believe so. If it is possible, it would likely be a convoluted process of somehow sending the information from the server to the client and then causing the client to reprocess the call.



If you need to use the alert function, you can consider either a client script or UI policy if the information is available on the client. If you need further information from the server, you may wish to incorporate an AJAX call within the client script. If you feel like sharing more insight into your situation, I may be able to provide you with some alternatives.


View solution in original post

4 REPLIES 4

joe_leser
Giga Contributor

There are two common options to alert a user when using a script include or business rule: immediate feedback upon the next form or list load with GlideSystem calls [gs.addInfoMessage() or gs.addErrorMessage()] or email feedback by creating an event which triggers the sending of an email defined within a notification.



More information on the GlideSystem calls can be found on the Wiki at http://wiki.servicenow.com/index.php?title=GlideSystem.


More information on events and notifications can be found on the Wiki at http://wiki.servicenow.com/index.php?title=Events_and_Email_Notification.


Thanks joe, I have another doubt.



Is it possible to create a pop up alert in business rule?


Since business rules run server side and the alert function is processed client side, I do not believe so. If it is possible, it would likely be a convoluted process of somehow sending the information from the server to the client and then causing the client to reprocess the call.



If you need to use the alert function, you can consider either a client script or UI policy if the information is available on the client. If you need further information from the server, you may wish to incorporate an AJAX call within the client script. If you feel like sharing more insight into your situation, I may be able to provide you with some alternatives.


Masarrat Siddi1
Kilo Guru

Hi,



Use below code in script section of business rule



var infoMsg = 'Information updated successfuly';
gs.addInfoMessage('<script>var t=setTimeout(function(){alert("' + msg + '")},500);</script>' + infoMsg);






Best Regards


Masarrat Siddiqui


Project Lead


Infobeans Technologies