- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 12:22 PM
Hello,
I am trying to populate a Lookup Select Box with the list of Mobile Phone #'s that is associated with a requested_for on an requested item form.
In the Past we have used the following Script Include called filterDevices on a reference qualifier line for a reference field.
function filterDevices() {
var answer = ' ';
var rf = current.variables.requested_for;
var usr = new GlideRecord('cmdb_ci_comm');
usr.addQuery('assigned_to',rf);
usr.query();
while (usr.next()) {
if (answer.length > 0) {
answer += (',' + usr.sys_id);
}
else {
answer = usr.sys_id;
}
}
return 'sys_idIN' + answer;
}
We have tried using this script include on the Lookup Select Box, but we do not get any results. We also tried variations of "assigned_to=current.variables.requested_for" and get 0 results. but when we tried "assigned_to=javascript:gs.getUserID()" it does return all mobile phones for the person logged in.
If anyone can point out if this is a syntax issue or if we are going about this incorrectly, it would much appreciated. Thanks
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 09:03 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 09:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 08:19 AM
Thank you for the response, I have seen those threads and still wasn't able to understand where we are messing up.
On the Variable Type Wiki Page it, provides an example of:
- Reference qual:caller_id=javascript:gs.getUserID()^active=true
Which is how we came to try assigned_to=current.variables.requested_for, which doesnt work for what i assume is syntax issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2015 12:58 PM
Thanks Pradeep, looks like the answer was in there I just didnt understand it at the time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2015 10:40 PM
Try following
javascript:'assigned_to='+current.requested_for