- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2017 12:39 PM
We are implementing a hardware refresh program and I am trying to create a catalog item using the order guides that we would send the users to to select their new hardware. One of the variables I have set up is a lookup multiple choice that uses the requested_for variable to pull back all of their assigned assets. This uses a script include I was able to find on this site. The requested_for is defaulted to the logged in user and when the form loads, it works like a charm and pulls back the list of assets. However, when I change requested_for on the form, the multiple choice options do not refresh. I'm assuming that this needs to be done with a Catalog Client Script with an onChange on requested_for but I can not get the script to actually make the change.
Solved! Go to Solution.
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2017 08:22 AM
I found a solution on an old thread and tried it and it works great. I had to add ref_qual_elements=requested_for in the Variable Attrributes and everything works as I need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2017 02:41 AM
Hi Tony,
For people to help you, you would have to share your scripts so someone can check it and identify necessary corrections.
BR
Marcus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2017 08:09 AM
Thanks for the reply.
I have a script include called getAssignedTo. From the variable in my form called old_computer, I used a lookup multiple choice option and as the reference qualifier I call the getAssignedTo().assigned().
In the form there is also a requested_for variable that defaults to the current logged in user, so when the form orginally loads, everything works fine as the script below runs to populate the choices for the old_computer variable. However when the requested_for changes, the choices for the old_computer do not refersh. I was thinking that I needed to include a Catalog UI policy (could be completely off base) that would run onChange when the requested_for variable changes. This is where I get stuck.
getAssignedTo:
var getAssignedTo = Class.create();
getAssignedTo.prototype = {
initialize: function() {
},
assigned:function() {
var gp = ' ';
var a = current.variables.requested_for;
if(!a)
return;
var grp = new GlideRecord('alm_hardware');
grp.addQuery('assigned_to', a);
grp.query();
while(grp.next()) {
if (gp.length > 0) {
gp += (',' + grp.sys_id);
}
else {
gp = grp.sys_id;
}
}
return 'sys_idIN' + gp;
},
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2017 08:22 AM
I found a solution on an old thread and tried it and it works great. I had to add ref_qual_elements=requested_for in the Variable Attrributes and everything works as I need.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2019 05:31 AM
I know this was an old post but as a recent new user, this has helped me no end. Thanks.