set reference qualifier through script for Lookup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2014 05:34 AM
I am working on Eureka and looking help to set reference qualifier through script for Lookup Select box catalog variable. I have two variables:
- Application - Select box
- Operation — Lookup select box
I put reference qual = "u_application_unit=" + current.variables.application for variable "Operation".
But this works only on load not on change of variable Application variable. reference current.variables in the reference qualifier and have the field refresh when another variable changes
Can anyone help me how to do this.
Thanks
Chandan !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2017 10:09 AM
Hello Jeeva,
I know this thread is from a couple years ago but I'm seeing it now and need to do exactly what I believe you are saying.
Your post above says: "Reference qualifiers in look up select box will not work on OnChange. You have to write OnChange catalog client script on Application variable and you can dynamically populate the options for Operation variable by querying the look up table"
Would the catalog client script alone achieve this? Or would I need a script include to do a GlideRecord or GlideAjax?
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2015 01:00 PM
Try to replace the g_form.getReference('requested_for')) to current.requested_for and also try to take out the client callable flag on the script include, maybe these guys runs in the server side
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2015 01:06 PM
Wouldn't make sense. At this point of the process the record isn't created yet. Also, request item table (current) doesn't have a requested_for, unless its smart enough to assume that current.requested_for = current.variables.requested_for even before the record is inserted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2015 01:17 PM
A bit more in depth
I have written this as the reference qualifier of caller in the incident form:
javascript:getUsers(current.description);
Then I populate the description with either true or false
I created a new script include, without the flag "client callable", named it as getUsers and on the script I erased all the object stuff and wrote:
function getUsers(active) {
return "active="+active;
}
It worked, if I wrote true on the description of the incident and tried to lookup for a user, it would show only active users, if I wrote false, then, only inactive users.
But what I failed to understand at first is that we were talking about catalog variables instead of fields in a form. As those runs in the server side, I believe you can use current.variables.requested_for
Give it a try and let us know...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2015 01:57 PM
Hi rfedoruk, I just tried in my test instance and it worked out.
If description is false then show inactive users:
But if description is true then show active users:
The reference qualifier as it is:
And the script include as it is:
I hope this helps you out.
Best regards,
Felipe