how to use codedvaluedomains with forms
I have an issue that i need help on.
The problem is that when you use coded value domains in a combobox via an input list derived from the getcodedvaluedomains activity, the code value is lost and subsequent comboboxes in the same form cannot utilize the selected value.
example:
say you wanted to select all counties in oregon
in my dataset there are two fields state and county. the State field has coded value domains the state field has ["AK":"Alaska"], ["OR":"Oregon"] etc
the county field just has the county name
if you use the coded value domain for state in the picklist, such as "Oregon" the query will not work because the combo box does not return the the field value, but instead returns the coded value.
so the were clause for counties would not work State = '{0}' and county like '%' to get only the counties in a selected state because {0} is not equal to the "Code" in the field but instead is equal to the coded value domain.
I think when one is using coded value domains in picklists, you should be able to enter a dictionary as the external data source to the form so the form could display the codedvalue and return the code to the nexts combobox.
any workarounds or suggestions would be helpful.
J
-
Jeff,
I think you can't make it work the cascading Comboboxes if you are using 'Input Data' as the data source for State using 'GetCodedValueDomain' as far as I know.
You may split it into two Forms: take a State value 'AK' at the first UI, and on the second Form to select County of the selected State.
Were you using 'DataItem List' of the GetCodedValueDomain activity for the State input data?
Have you tried to use 'Result' which is IDictionary<object, string> from the GetCodedValueDomain activity, and set Display Field as Value, and Value Field as Key, which I have not tried here, but worth to try I think?
If it is not work, I think you need to use two forms.
Munhwan
0
Please sign in to leave a comment.
Comments
1 comment