- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 11:20 PM - edited 01-31-2024 12:22 AM
Hi,
There 2 fields supplier and product. Product choices are dependent on supplier value, based on the value of the supplier the product choices should be hidden in list view. we can do this in form using onChange client script with add option and clear options. How can we achieve this in list view?
For example:
Supplier fields has supplier A and supplier B
Product has A,B & C
When supplier field is selected as supplier A then product should show A & B
When supplier field is selected as supplier B then product should show B & C
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 01:07 AM
Yes, absolutely.
1. Once you have selected the dependent field as "Supplier" in Product dictionary form.
2. Scroll down to choices and define as many choice you want to make visible based on selection of Supplier as shown below:
Also please read the docs link attached before, that has clear explanation on how you can achieve this easily.
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 11:49 PM
Hi @BALAJI K R ,
Please follow the steps below to achieve this both in form and list view together. You do not need a script for this requirement:
1. Please make use of dependent fields concept in ServiceNow - https://docs.servicenow.com/bundle/vancouver-platform-administration/page/administer/field-administr...
2. Navigate to dictionary of "Product" attribute and click on "Advanced view" and select Supplier as a dependent field. For example please see a similar thing done OOTB for incident table between Category and Subcategory attribute:
This will work for both form and list view.
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 12:10 AM - edited 01-31-2024 12:13 AM
Yes, but is it possible to give 2 dependent values to a single choice in product?
For example:
supplier fields has supplier A and supplier B
Product has A,B & C
When supplier field is selected as supplier A then product should show A & B
When supplier field is selected as supplier B then product should show B & C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 01:07 AM
Yes, absolutely.
1. Once you have selected the dependent field as "Supplier" in Product dictionary form.
2. Scroll down to choices and define as many choice you want to make visible based on selection of Supplier as shown below:
Also please read the docs link attached before, that has clear explanation on how you can achieve this easily.
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 12:00 AM
Hi @shloke04 ,
Yes it is possible using g_form.addOptions and remove options but as already mentioned by other colleague you can do it by dependent field concept, hence you should be going for dependent field OOB feature.
Please mark helpful/correct if my response helped you.