- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2017 01:29 AM
Hi All,
I have 3 fields and they are choice field with dependency
Some choice in the 2nd field don't have any depended values in the 3 field.
I want to hide the 3 field if there are no depended choices.
Its a bit similar to OOB category/subcateogry except they don't hide the field if there are no sub categories.
Any suggestions welcome
Thanks,
Ellie
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2017 02:15 AM
You can use the following script:-
- var gp = new GlideRecord('sys_choice');
- gp.addQuery('dependent_value', newValue);
- gp.addQuery('element', 'subcategory'); //If you have a label for it
- gp.query();
- if(!gp.next())
- {
- g_form.setVisible('your variable', false);
- }
It might NOT be exactly the same, you might need to tweak it a bit but this is the general idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2017 09:45 AM
Thanks Das this is working now I found that a UI Policy caused a conflict.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2017 02:10 AM
Need to add the fields are all on incident table