- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2020 07:18 AM
I would try the following script:
function advloc() {
var locPar;
var userLoc = '';
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', gs.getUserID());
gr.query();
if (gr.next()) {
userLoc = gr.location + "";
}
if (userLoc.indexOf("MG") == -1) {
locPar = "";
} else {
locPar = "parent=" + userLoc;
}
return locPar
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2020 07:23 AM
This points me in the right direction, but doesn't work as an advanced reference qualifier for the variable.. I might need to rethink the way I am doing this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2020 07:25 AM
Where are you calling this from? For reference qualifiers you should call a script include that returns the information you want available in the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2020 07:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2020 07:39 AM
You're on the right track. That script belongs in a script include that is client callable:


And in your reference qualifier you would just do:
new getLocation().locations();