- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2017 01:27 PM
We are using a client script to be able to populate location automatically when there is a screen pop. The screen pop happens for us when we get a call and the user pops up, they then click new incident on the users page and it brings them to the incident form. Originally, the location was not populating, but we wrote a script to populate it. I will put in the script below to give a reference, but the ulitmate goal is still having the ability to update the location because we also will change a users location to "Remote Office" when they are having problems outside of the office.
function onLoad()
{
var caller = g_form.getReference('caller_id', setLocation);
}
function setLocation(caller) {
if (caller) g_form.setValue('location', caller.location);
}
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2017 01:33 PM
You can add a condition to check the current location value:
function onLoad() {
var location = g_form.getValue('location');
if(!location) {
var caller = g_form.getReference('caller_id', setLocation);
}
}
function setLocation(caller) {
if (caller) g_form.setValue('location', caller.location);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2020 05:07 AM
When I use this I am getting sysID as display value can anyone suggest how to populate location using client script