Dynamic Dialog lists

There are two fields on a particular form: geography and country. There can be multiple values for the geography field and the country field dialog box needs to display the countries within the geographies selected. Right now I am using @DBLookup to populate the list with the proper countries that are in a view, but this only works if one geography is selected. →

@If(IBMgeographies = “Latin America”;

@DbLookup(“”:“NoCache”;“”; “countryList”;“Latin America”;“countries”);

IBMgeographies = “North America”;

@DbLookup(“”:“NoCache”;“”; “countryList”;“North America”;“countries”);

IBMgeographies = “EMEA”;

@DbLookup(“”:“NoCache”;“”; “countryList”;“EMEA”;“countries”);

IBMgeographies = “Asia-Pacific”;

@DbLookup(“”:“NoCache”;“”; “countryList”;“Asia-Pacific”;“countries”);“”)

How do I dynamically generate the country list to represent multiple geographies selected? Is there a way to populate a choice list and then pass the choice list to a dialog box function?

Thanks in advance!

Subject: Dynamic Dialog lists

Assuming that stuffing a list into the key parameter of @DBLookup causes problems (have you tried that?), you might try something like this:

@For(x := 1;

x <= @Elements(IBMGeograpies);

x := x + 1;

GList := GList:@DbLookup(“”:“NoCache”;“”; “countryList”;IBMGeographies;“countries”);

);

@Unique(GList);

That should probably be wrapped up in an @If to make sure that you don’t have any problems if IBMGeographies is empty.

Subject: RE: Dynamic Dialog lists

That looks like it would work, but unfortunately no luck. Thanks anyway!

Subject: RE: Dynamic Dialog lists

Using the entire list as a parameter for @DBLookup, or the loop?

Subject: Dynamic Dialog lists

You should be able to use the multivalue field IBMGeographies as your key. You will get back all the matches. Have you tried this?

Subject: RE: Dynamic Dialog lists

Yes, that worked. Thank you!