how to display an alert message from the server script ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2014 03:35 AM
i wrote a business rule script and i want an alert to be displayed once the condition is true. this is my script
if((!current.start_date.nil())&&(!current.end_date.nil()))
{
var
startdate = current.start_date.getGlideObject().getNumericValue();
var
enddate = current.end_date.getGlideObject().getNumericValue();
if
(startdate > enddate) {
gs.addInfoMessage('start must be before end date'); // i should not use this or error message please help me out
current.setAbortAction(true);
}
}
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2014 04:10 AM
Hi Shrinandhini,
Since a Business Rule runs server side, I do not believe the alert function will work as you want, as this function is processed on client side. Maybe it's possible in a complex way..
From server side, the only way I know to warning messages are through GlideSystem calls [gs.addInfoMessage() or gs.addErrorMessage()].
Otherwise, if you really want some kind of popup message window, maybe you could try to use this script validation in a Client Script, UI Action or UI Policy, which are processed on client side.
Cheers,
Rodrigo Higa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2014 04:17 AM
yeah thanku !!!