How to create dependent variables in Multi row variable sets

pramodkumar
Tera Expert

Hi All,

we have a requirement to create 3 variables in MVRS, Category, sub category and quantity. When a category is selected, only the sub categories associated to that category should be displayed. How can we achieve this?

 

Thanks! 

1 ACCEPTED SOLUTION

Michael Jones -
Giga Sage

Depending on the number of options and how dynamic you need your options to be, you can script it, or you can use a table driven approach as Sachin suggests and outlines. The one thing that I would add is that, if you want to use a table driven approach without a custom table, you can load your options in the sys_choice table and set the reference on your lookup select box that table. It's more or less made for this type of option / dependent value format. 

For example, I made these sys_choices: 

find_real_file.png

Then two lookup select boxes on my mrvs: (be sure to make note of the variable attributes and reference qualifiers

find_real_file.png

And this is what I get...

find_real_file.png

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

8 REPLIES 8

Thanks @Michael Jones - GlideFast for the response.

Can you tell me whats the reference qualifier Sub Category.

 

Thanks!

Sure, I used: 

javascript:"element=mrvs_sub^dependent_value=" + current.variables.category

With a variable Attribute of: 

ref_qual_elements=category

That way, when you change the value for category values for current are passed back to the server and the reference qualifier is re-processed. 

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Hi Michael,

The solution is good but causes issues when creating client scripts or ui policies. How did you get around the issue?

Because these variables are now looking at the sys_choice table when creating one of the above, it only shows the first 1000 records which is from a to e. If your choices do not start with a,b,c,d or e then it cannot be selected in ui policy and cannot be found when creating script

Community Alums
Not applicable

@Michael Jones - GlideFast I tried the solution you provided. It worked very well for me.