Dictionary Processes are very useful for quickly creating centrally managed lookup data. Besides features such as the dedicated Dictionary view and Import/Export, WEBCON automatically creates and maintains the corresponding Data Source.
However, there seems to be no way to configure the sorting of this automatically generated Data Source.
For example, I have a Dictionary containing application names which is used as the Data Source of a Choice Field. The entries should simply be displayed alphabetically by Name.
The generated query, however, ends with:
ORDER BY WFD_ID DESC
The Advanced Filter cannot be used for this purpose because it is inserted into the WHERE clause. Adding an ORDER BY there therefore produces invalid SQL.
The only workaround I can currently see is to create an additional custom Data Source based on the Dictionary just to add:
ORDER BY Name
This somewhat defeats the purpose of the automatically generated Dictionary Data Source. A basic presentation requirement such as alphabetical sorting should not require creating and maintaining a second Data Source.
There is also an inconsistency between the different Choice Field presentation types:
Autocomplete – no option to sort by the Display field.
Popup search window – no option to sort by the Display field.
Dropdown – provides Sort by Display field, but Dropdown does not support mapping additional Data Source columns to form fields.
So switching to Dropdown is not an alternative when the Choice Field is also used to populate other form fields from the selected Dictionary entry.
Suggestion: Add sorting configuration to automatically generated Dictionary Data Sources, for example:
Sort column: Name
Direction: Ascending / Descending
Alternatively, provide the existing Sort by Display field functionality consistently for Autocomplete and Popup search window as well.
I would consider this more of a missing basic Dictionary/Choice Field functionality than a special use case.
EDIT:
There is an additional problem when replacing the automatically generated Dictionary Data Source with a custom Data Source as a workaround.
The native Dictionary Data Source uses WFD_Guid as the ID of a Dictionary entry. Therefore, existing Choice Field values are stored using the Dictionary GUID, e.g.:
278aasf0809safas08s0f9#Activities
After switching the Choice Field to a custom Data Source, the ID may instead be based on WFD_ID, resulting in newly stored values such as:
29804#Activities
This means that existing and new workflow instances can contain different IDs for the same Dictionary entry.
To preserve compatibility, the custom Data Source has to explicitly reproduce the Dictionary behavior and expose WFD_Guid as its ID, e.g. by adding it as a calculated column.
So a workaround required only to achieve alphabetical sorting can also introduce an ID compatibility problem with existing workflow instances.
This makes configurable sorting of the native Dictionary Data Source even more important.