- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2020 06:35 AM
Hello,
I have record producer with 2 variable sets. I need to decide whether to show the second variable set based on the value that is entered in the first variable set. I assume that a UI Policy or a client script should solve this issue, however, it seems that accessing variables from another variable set is not a straight-forward task. Please let me know if you have tried something like this before.
Note: Both variable sets are multi-row variable set.
Thanks,
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 01:10 AM
Use the onSubmit client script on catalog item level.
Limitation MRVs
Note:
- 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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 05:42 AM
that's the reason i asked you for screenshot ,
anyway , that will also hide. can you paste the script which you have used till now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 05:42 AM
Here are screenshots of what I did:
variable sets:
First variable set (sm_variable_seta):
second variable set (it_to_its):
The client script (test client script), which is added to the first variable set (sm_variable_seta):
The record producer:
I follow these steps but the variable "another_vs" never disappears:
(1) Open record producer page.
(2) Enter this value in the one_vs field: "harsh".
(3) Change the value in one_vs to "abc".
(4) Change the value in one_vs back to "harsh".
(5) Fill the other fields.
(6) Click on Submit button

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 05:45 AM
you are testing on portal, so you have to set UI type as ALL in your catalog client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 06:04 AM
Thanks. so I changed the UI Type to "All" and it worked. But as I told you, in my case the client script should be on a MRVS not a single row variable set so I created a new variable set and called it: mrvs and added the client script there as you can see in the following screenshots. I also disabled the previous client script.
Here are the steps that I follow:
(1) Open record producer
(2) Click on Add button
(3) A popup will open and then I'll set "mrvs_variable" to "harsh".
(4) Click on "Add" in the popup
Expected result: "coming inside if" alert should appear and the variable "another_vs" should disappear.
Actual result: "coming inside if" alert should appear but the variable "another_vs" does NOT disappear.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 06:16 AM
glad it helped,
it will also possible.
sample code:
function onSubmit() {
//Type appropriate comment here, and begin script below
var ab = JSON.parse(g_form.getValue('apps_enable'));
for(var i = 0 ; i < ab.length; i++){
if(ab[i].set == 'No'){
alert('hey');
g_form.setDisplay('appss',false);
return false;
}
else{
g_form.setDisplay('appss',true);
return false;
}
}
}
Note: apps_enable is MRVs ( here "set " is column in MRVs, so you will add your column based on your have ) and "appss" will be your another variable set.
If my answer helped you, kindly mark my answer as correct and helpful.