Same choices dependent on multiple values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2018 05:27 AM
I have a state field with values as Pending and Review and few other values.
I have a substate field which is dependent on state field. When state is Pending/Review, sub state should show below values;
- Pending Change
- Pending Incident
- Pending Problem
How can I have same values dependent on Pending as well as Review?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2018 05:34 AM
Hi Swathi,
You can write onLoad Client Script for this dependancy.
Please find below sample code for the same:
function onLoad() {
//Type appropriate comment here, and begin script below
if(g_form.getValue('state') == '1'){
g_form.removeOption('state', '2'); // your substate values which you want to hide
g_form.removeOption('state', '3');
g_form.removeOption('state', '6');
// g_form.removeOption('state', '7');
// g_form.removeOption('state', '8');
}
}
You can also make use of g_form.addOption() method, which will add your substate choices (already present) on selection of a particular state.
Hope this helps!
Please mark my answer as Correct/Helpful in case that helped.
Regards,
Vishrut
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2018 06:23 AM
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 06:27 AM
Script working fine on form but users becoming smart. They found a bug and setting the value from the list view.
How to make sure the removed options are also not present in the field from list view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2018 05:46 AM