How to create a ServiceNow popup alert box in business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 05:42 AM
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:
also 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 06:09 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 06:32 AM
not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 06:41 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 06:48 AM
not working. getting same output without popup