Alert or confirmation message after business rule successful execution

Ronak Jhaveri
Kilo Expert

Hi

I want to display confirmation POPUP message like "Workorder<WO> has been submitted successfully in ServiceNow. Please note Service <ServiceID> for further communication."

What i initially did was to add message in addInfoMessage but this is not what i required. I need message to be displayed in popup message.

Note: <WO> and <ServiceID> are the values coming from server side to be displayed.

How can i achieve this?

3 REPLIES 3

amaradiswamy
Kilo Sage

Hi,

Are you creating work order and Service ID in another table in BR?. As BR runs on server side, we can't initiate pop-up windows from this. However, you may try below approach.

1. Create an onsubmit script and put the server side script in a script include. Use GlideAjax and getXMLWait 

2. In call back function , assign value returned from server side and display it using alert(answer);

sam352120
Kilo Guru

Hi Ronak,

 

As a BR is a server side script you can use the following piece of line in your BR to throw a message when it got completed.

gs.addInfoMessage("Message Completion");

 

 

Thanks,

Sambit

Jyoti8
Kilo Guru

 

Hi Ronak,

 

"Workorder<WO> has been submitted successfully in ServiceNow. Please note Service <ServiceID> for further communication."

To Retrieve this fields from server try below code : 

g_scratchpad.WO = current.WO; 
g_scratchpad.ServiceID = current.ServiceID;

For Popup try this :
gs.addInfoMessage("Workorder has been submitted successfully in ServiceNow. Please note Service ID for further communication.");