One field is dependent on two fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2016 06:12 AM
Hi,
I have category and subcategory choice fields on change form.
subcategory field values depends on both type and category choice fields.
Ex:
If category is x and type is normal then subcategory should be p,q
if category is x and type is emergency then subcategory should be y,z
how to achieve two way dependency on subcategory field?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2016 06:16 AM
Hi Alvatindra,
Choice list dependency only works against one dependent field. One option to meet your requirement is to use reference fields instead of choice fields and use an advanced reference qualifier to do the filtering. This does involve a bit of scripting.
Reference Qualifiers - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2016 06:18 AM
Hi,
There is no way you can achieve it by adding it as dependent field, since it allows only one field dependency,
You can try using on change client script and check values for both type and category every time subcat is changed and call glideajax for a lookup table,
where you can store the relative values for them.
Let me know if that helps.
Thanks
Gaurav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2016 06:22 AM
You can use Use Data Lookup Rules.
http://wiki.servicenow.com/index.php?title=Data_Lookup_and_Record_Matching_Support#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2016 06:26 AM
Good call Deep K! This is the same method used by incidents to define priority = impact + urgency. As long as the getters & setters are on the same table, this is the best solution.