- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 01:25 AM
I have a Record Producer with this structure.
Record Producer{
Variable 1
Variable Set {
Variable 2
}
}
Variable 1 is inside the record producer but Variable 2 is in a variable set. I want to use variable 1 value to filter Variable 2 using an advanced reference qualifier but 'current.variables' refers to the variables in the variable set so I can't access variable 1.
Is there any way to achieve this?
Edit: This is a multi-row variable set.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2019 07:02 AM
Not sure if Variable 2 is the one that needs the reference qualifier, but according to the documentation Service catalog variable sets:
Note:
- onSubmit catalog client scripts are not supported for a multi-row variable set.
- Catalog UI policies and catalog client scripts defined at the item level are not applicable for variables in a multi-row variable set. Only those catalog UI policies and catalog client scripts defined within the multi-row variable set are applicable for variables in the multi-row variable set.
- Scripts that are not included in a multi-row variable set cannot affect variables inside the multi-row variable set. Similarly, the scripts included in the multi-row variable set cannot affect the variables that are not included in the multi-row variable set.
- Variables that are not included in a multi-row variable set cannot be used in dependent reference qualifiers for variables in the multi-row variable set. Similarly, the variables included in the multi-row variable set cannot be used in dependent reference qualifiers for variables that are not in the multi-row variable set. For a reference qualifier, the current row is the one that is being edited.
This may be why it is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 01:40 AM
Hello Stefan,
I tested your solution and just wanted to let you know that this wont work on Portal. It works fine in normal UI but wont work on Service Portal.
As a work around i do the following:
1. Create an onChange client script for the variables.company variable and store the value in a "parent.companyID" value.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
parent.parentCompanyID = newValue;
}
2. Create an onLoad client script in the Multi Row variable and do something like
function onLoad() {
//Set company ID to field
g_form.setValue('companyid', parent.parentCompanyID);
}
PS: There is also the following: g_service_catalog.parent.getValue('company')
The above works in Portal and in normal UI.
Cheers,
Manolis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 05:05 AM
Hello Manolis,
I only had this requirement for the normal UI so i did not test it on the portal. Maybe i had to mention this in my post. Do i see a little typo in your client script at step 1?
"parent.parentCompanyID = newValue;" should be: "parent.CompanyID = newValue;"
Thank you for testing this and creating a work around!
Regards,
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 05:16 AM
You are right, just corrected the typo.
The first part is a "dirty workaround". I think the best solution would be the function from SNOW:
g_service_catalog.parent.getValue('company')
I also linked the related doc.
Cheers,
Manolis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Stefan,
I'm having similar kind of requirement, and using your way it is working perfectly, but the only issue is I'm not able to hide that new hidden variable of MRVS from the MRVS Grid, It's not visible on Modal but still there in the Grid. You can see Business Divisions from my screenshots.
