- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2022 02:17 AM
Hi,
I have a record producer where the options in select box variable "Report" needs to be adjusted based on the value in variable "Category". So if category is A then option 1, 2, 3, 4 should be visible in "Report". But if category is B then only option 1 and 2 should be visible. How to script this?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2022 03:10 AM
onCHange client script
field name : category
if(newValue =="Backend name of Description"){
g_form.removeOption("backend name of Report variable",'backend name of the option you want to remove');
g_form.removeOption("backend name of Report variable",'backend name of the option you want to remove');
//like this you can keep on adding line into this loop
}
Code explaination:
if category is general all the option will be shown if it is description then i am reoving some option
Please mark it as correct and helpful if this answer satisfies your query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2022 02:20 AM
Hi,
You can write onChange client script with method removeOption.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2022 02:21 AM
Could you help me some more with how to write the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2022 02:23 AM
Give the backend name of your variables and choices.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2022 03:01 AM
Variable Category options:
General
Description
Variable Report options:
Deviation
Improvement
Standard
Other
So if Category is general then only Deviation and Improvement should be visible in report. If category is Description then all should be visible,