Skip to content

MRVS Reference Qualifier Includes Value From Catalog Item Variable #1078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function onLoad() {
var mgr = g_service_catalog.parent.getValue('v_manager'); //Catalog Item Variable Name
var filter = g_list.get('v_employee'); //MRVS variable name
filter.setQuery('active=true^manager=' + mgr);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*** This solution uses g_list, so it works in Service Portal (and I assume ESC) only, not the native UI / Service Catalog interface ***<br>
Developed in collaboration with Chris Perry


On a reference variable in a multi-row variable set, sometimes you want the reference qualifier to include the value of a variable that is part of the Catalog Item, not within the MRVS

When using this script that applies to the Variable set, not the Catalog Item, leave the Reference qualifier field on the MRVS variable empty

In this simplified example, I have a Manager (v_manager) reference variable (sys_user table) that belongs to the Catalog Item. In the MRVS, I have an Employee (v_employee) reference variable (sys_user table). I only want to be able to select user records that are active, and the Manager is the user I selected on the Catalog Item variable.
Loading