- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2019 07:15 AM
Hello,
I have to pre-fill a field on a record producer with the Country of the person creating the incident.
I tried using javascript:gs.getUser().getLocation(); , however this only returns the location of the user, I require the country field. I tried using different variants on this script but I can't get it to work.
Can anyone help me to achieve this?
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2019 02:28 AM
Try now
Script include name : UserObjectUtils
var UserObjectUtils = Class.create();
UserObjectUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
var user = new GlideRecord("sys_user");
user.addQuery("sys_id", gs.getUserID());
user.setLimit(1)
user.query();
if (user.next()) {
return user.location.country;
}
},
type: 'UserObjectUtils'
});
Your refernce qualifier is javascript:new UserObjectUtils().getCountry()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2020 06:18 AM
I need to use the filter in the reporting on incident form.
filter-caller.location.country should be equal to "current logged in user".