How to create a ServiceNow popup alert box in business rule

Prashant More1
Kilo Contributor

I want to create  ServiceNow popup alert box from   business rule . for that purpose I have used 

gs.addInfoMessage('WorkOrder '+current.number+' submitted successfully!'); in business logic but

The result looks like this:

find_real_file.pngalso tried below code

var msg = 'WorkOrder submitted successfully;
gs.addInfoMessage('<script type=text/javascript>var t=setTimeout(function(){alert("' + msg + '")},500);</script>' + msg);

it also giving me the same output no popup.

please suggest the code  for creating servicenow popup alert box with business rule

 

Thanks,

Prashant More

4 REPLIES 4

Community Alums
Not applicable

Never tested if this will work in business rule but you can give it a shot (actually its an client side, but you can use Ajax to call it):

var dialog = new GlideDialogWindow(pageName);
dialog.setTitle("Window Title Here");
dialog.render();

 

Note that pageName is the table you need to open. If only Yes/No there is OOB page for that also

not working

Jaspal Singh
Mega Patron
Mega Patron

Hi Prashant,

 

Can you try using below.

var msg = 'WorkOrder submitted successfully';
gs.addInfoMessage('<script type=text/javascript>var t=setTimeout(function(){alert("' + msg + '")},500);</script>' + msg);

 

Also, you may find link helpful.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

not working. getting same output  without popup