What is best practice for setting up multiple fields with dependencies

chrish5
Giga Guru

On our Location form I have added a tab called Network Hardware to list the possible switches a location may have.  On this tab there is a Switch 1 Vendor field, and under that, a Switch 1 Model field.  Switch 1 Vendor has four possible choices and we can call them A, B, C and D for the purpose of this question.  The Switch 1 Model field under that has 22 possible choices and we can just call them 1 – 22.  By right clicking on Switch 1 Model and selecting Configure Dictionary, I created these 22 choices with dependencies on what is selected for Switch 1 Vendor.  So if A is selected for Switch 1 Vendor, then Switch 1 Model only shows 1 – 12, like the below list shows for all the possible Vendor choices.

 

Switch 1 Vendor = A

Switch 1 Model (1 - 12)

 

Switch 1 Vendor = B

Switch 1 Model (13 - 17)

 

Switch 1 Vendor = C

Switch 1 Model (18 - 19)

 

Switch 1 Vendor = D

Switch 1 Model (20 - 22)

 

I have to create these two fields for 10 switches, so after creating the same choices and dependencies again for Switch 2 Vendor and Switch 2 Model, I’m thinking there has to be a better way to create one choice list for Vendor and one choice list for Model and pull them into the 10 Vendor fields and 10 Model fields. As I looked into this more, I did notice that the Vendor and Model choices I created are being stored in the Choice (sys_choice) table with each record referencing the Location (cmn_lacation) table.  As I looked more at the Dictionary Entry page, I saw that I could pull in the Location table on the Choice List Specification tab.  So, for Switch 3 Vendor,  on the Choice List Specification tab, I set Choice to “Dropdown with None”, set Choice Table to “Location” and set Choice field to “Switch 1 Vendor”.   This worked and had A, B, C and D available for selection in the Switch 3 Vendor field.  For the Switch 3 Model field Choice List Specifications, I set Choice to “Dropdown with None”, set Choice Table to “Location” and set Choice field to “Switch 1 Model”.   This worked in a sense, by pulling all 22 choices into the Switch 3 Model dropdown, but I’m not getting the dependencies.  So if "A" is selected for Switch 3 Vendor, I see all 22 choices in Switch 3 Model instead of only 1 – 12. 

 

If I look at the records in the Choice table, I can see that the records list the dependency.  As an example, I see the below records showing that Switch 1 Model choice “1” is dependent on “A”, so why does this dependency not carry thru when pulling in the table choices?  Am I missing something?   Is there an easier way to do this that I’m not seeing.  I just want to build one choice list each for Vendor and Model and use it multiple times, with the dependency.    Thanks for any help provided! 

 

(Record 1)

Table = cmn_location

Element = u_switch_1_vendor

Value = A

Dependent value =

 

(Record 2)

Table = cmn_location

Element = u_switch_1_model

Value = 1

Dependent value = A

1 ACCEPTED SOLUTION

chrish5
Giga Guru

As I played around with this more, I see that I had not set the dependency information on the Dependent field tab.   Once this was done, it worked as expected. 

View solution in original post

1 REPLY 1

chrish5
Giga Guru

As I played around with this more, I see that I had not set the dependency information on the Dependent field tab.   Once this was done, it worked as expected.