- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 12:23 PM
I have variables on a record producer that need to be dependent on the previous variable. I have tried using the auto-populate but it doesn't seem to work. Is there another way to achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 01:34 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 01:04 PM
What do you mean by dependent? That to say you want to make a variable let say mandatory based on the previous. However, you are talking about auto-populate so are you trying to populate what is in the variable based on the previous one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 01:12 PM
Hi @DreDay3000
Create a catalog client script.
//onchange client script
if (newValue == ‘option_1_value’) {
// Set the options for Variable B when Option 1 is selected in Variable A
g_form.clearOptions(‘variable_b’);
g_form.addOption(‘variable_b’, ‘1’, ‘Option B1’);
g_form.addOption(‘variable_b’, ‘2’, ‘Option B2’);
} else if (newValue == ‘option_2_value’) {
// Set different options for Variable B when Option 2 is selected in Variable A
g_form.clearOptions(‘variable_b’);
g_form.addOption(‘variable_b’, ‘3’, ‘Option B3’);
g_form.addOption(‘variable_b’, ‘4’, ‘Option B4’);
}
// Continue for other options as necessary
}
Note: use g_form.setValue('field_name' , 'value'); to set the variable 2 value based on variable 1
Please mark it helpful and accepted if this helps you in somehow. This will help both community and me.
Thanks and Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 01:34 PM
javascript:'building='+current.variables.building