Ankit P
Mega Guru

This post is to show how you can create a dependency between two variables similar to the Subcategory and Category field dependencies on the Incident form. This often comes as a requirement to add to the Create Incident record producer.

1. Create the variable Category:

find_real_file.png

 

2. Create the variable Subcategory:

find_real_file.png

 

3. Add this in the Variable Attributes-

"ref_qual_elements=category" without quotes.

 

That is all. Now, you don't have to create onChange client scripts or custom tables to handle the dependencies on Variables. Don't forget to mark as helpful if it helped :).

Comments
adi narayana
Tera Contributor

sorry it not working 

Ankit P
Mega Guru

Could you please send the screenshots of your configurations?

Sarvesh Prajapa
Tera Contributor

put the ref_qual_elements=category inside the Reference qualifier section instead of Default value section

WazzaJC
Tera Expert

Ankit,

 

This is fantastic, it worked perfectly for me and just the solution that I needed to configure for my client!

 

Thanks ever so much for sharing, greatly appreciated Ankit.

Keerthi Lakshmi
Tera Contributor

It is working perfectly. I have an query that do we can made the subcategory field to select more than one item.

philipzhekov
Tera Contributor

@Ankit P thanks for providing your solution, it's working as it should. I can confirm this is working on a regular catalog item as well.

AysenurU
Tera Contributor

Hi

 

This solution saved me from writing a bulky client script and script include.  Thank you very very much.

 

One quick note; I naively just added ref_qual_elements=category into the reference qualifier. However, after adding javascript:"element=subcategory^name=incident^dependent_value=" + current.variables.category this solution worked. 

 

Mind what you are pasting 😀

 

 

MujeebQ
Giga Contributor

javascript:"element=subcategory^name=incident^dependent_value=" + current.variables.category

Worked for me.

Version history
Last update:
‎04-30-2020 05:49 AM
Updated by: