diff --git a/Catalog Client Script/MRVS Reference Qualifier from Catalog Item Variable/mrvs_ref_qual.js b/Catalog Client Script/MRVS Reference Qualifier from Catalog Item Variable/mrvs_ref_qual.js new file mode 100644 index 0000000000..b4a3d93101 --- /dev/null +++ b/Catalog Client Script/MRVS Reference Qualifier from Catalog Item Variable/mrvs_ref_qual.js @@ -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); +} diff --git a/Catalog Client Script/MRVS Reference Qualifier from Catalog Item Variable/readme.md b/Catalog Client Script/MRVS Reference Qualifier from Catalog Item Variable/readme.md new file mode 100644 index 0000000000..506fabdb2e --- /dev/null +++ b/Catalog Client Script/MRVS Reference Qualifier from Catalog Item Variable/readme.md @@ -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 ***
+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.