Status: Open
Status: Answered
Status: Closed
Status: Duplicate

Parent and Child Dropdown loading

Posted Aug 22 by Sathish Kumar.



I have two dropdowns Country and State.


When loading the form, i set the first value(Country Values - e.g US) to Parent dropdown.


I want to set the first value(State Values - e.g NY) to State dropdown based on the Parent DDL value in same form load.


Any Ideas?

1 Answer

BEST ANSWER: As chosen by the author.

I am not sure I am reading you right, but if what you are trying to do is to have the State dropdown list change based on the Selected Country then you can code it on the Country Change request.


Add an additional local variable like memSQL to the form:


On form load set this value to a base value as to prevent it from failing later:



Local.memSQL = "select '' from <Your table name here> where rownum = 1";



Local.memSQL = "select top 1 '' from <Your table name here>";


Set the Country drop down to has Dependents

Set the State drop down to is Dependent


On the Country Drop Down ON CHANGE event set the memSQL value as such


memSQL= "Select States from StateTable where StateCountry = '" + Local.CountryDropDown + "'"


Change the List options for the State Drop Down as follows:


SelectSql(new MetastormDefault(), Local.memSQL)



Now the State Drop down will load blank on form load

and then every time you select a country the State list will adjust itself based on the selected country.





 You have subscribed and will receive email notifications of updates to this topic. To unsubscribe, uncheck the checkbox.


Related categories

Related tags

Your answer

To leave an answer, please sign in.