- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2024 02:10 AM
Hi
How would i Show Alert message on creating an incident record it should display the caller's location. By using g_scratchpad in BusinessRule and client script..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2024 03:43 AM
@Rajkumar Bommal - ah apologies, it was the caller's location not the current user.š
If so, you can update the BR to
(function executeRule(current, previous /*null when async*/ ) {
var userGr = new GlideRecord("sys_user");
userGr.get(current.getValue('caller_id'));
g_scratchpad.currentLocation = userGr.getDisplayValue('location');
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2024 03:14 AM
g_scratchpad to do a one-time push of the information from the server when the form is loaded, and b) a GlideAjax call to have the client script call the server and the server return a result. Async GlideAjax is recommended!
mark if correct/helpful.
Regards,
Pushpanjali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2024 03:15 AM
BusinessRule
Client Script- onload
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2024 03:20 AM
Scripts look fine, can you share a screenshot of the current user's record with the location field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2024 03:38 AM
can you use the below line and check once if it works for you.
g_scratchpad.currentLocation = userGr.location.name;
Thanks & Regards,
Anitha H V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-28-2024 03:45 AM
@1__AnithaHV
Thanks For the reply but it is also not working