- 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 12:40 AM
try now, added alert as well , so validate, what are you getting in alert.
function onSubmit() {
var value = g_form.getValue("my_variable");
alert(value);
if (value == "A") {
alert("value is A");
g_form.setDisplay("vs2", true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 12:53 AM
Hi Harshvardhan, The value is retrieved correctly from my_variable. I already checked that.
the first alert is A the second alert also works.
Note: Obviously it is not an issue of whether it goes inside the if statement or not. It is an issue of whether the second variable set is accessible from here or not.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 12:55 AM
if second variable sets variable is on your form then you will able to set it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 12:56 AM
Unfortunately I'm not. Did you try it and it worked?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 12:58 AM
can you add screenshot of your form?
make sure the other variable which you are trying to hide is not mandatory