Hi,
I am trying to implement a Country >> States list with only 3 countries (USA, Canada, Mexico). Instead of deleting dozens of entries from the DNN Country list (under Host >> Lists page), I created a new list called "Country2 and added 3 entries (USA, Canada, and Mexico)
I created anloth 'List' called 'State' and chose Country2 as the Parent list and added States for each Parent entry (USA, Canad, na Mexico)
Now I have the following lists under Host >> Lists
+Country2
---Country2.Canada:State
---Country2.Mexicao:State
---Country2.USA.State
I created a new combobox (called "Country3") and added the following SQL under SQL options:
select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'Country2' ORDER by QuestionOption ASC
It is correctly populating the three entries I created (in fact, four, including the 'select one' entry.
So far so good....
I created another Combobox and called it State. I used the following SQL to populate the list.
select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'State' AND ParentID = '$(Country2)'.
It gives SQL error.
I replaced token with the actual Country value, USA (see the full SQL)
select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'State' AND ParentID = 'USA'
It still gives SQL Error.
Whewn I remove the AND clause, it works; but it list ALL the States from ALL the countries (as expected)
select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'State' >>>> (this works)
Questions:
1. Should we define the lists with Parent Child relationship under Host >> Lists to implement the dependent lists?
2. When we use the 'built-in' DNN Country and DNN REgion fields in Dynamic Forms, it creates a Text field for the Region (instead of Combo box. bjut it changes dynamically to Combo box. Can we leverage the existing DNN Region lists and make it work with a new Country list with fewer entries?
basically I would like to know the best way to implement Country >> States lists for 3 or 4 countries without deleting the existing Country list...
The SQL statements used in Demo11 are too complex without access to the exact data under Hosts >> Lists.
Can we use the existing DNN Country list and Region list as the source and implement our own Country combox with a SQL that will limit the countries to just few?
Any help is greatly appreciated.