Clarity: Lookup Parameter Mapping changes sort order of saved multi valued lookup attribute values to sort by the hidden key ascending order.

Document ID : KB000022699
Last Modified Date : 14/02/2018
Show Technical Document Details


When defining a lookup, a default sort order is applied to the browse window which is carried through to the display in the UI after the values have been selected and saved.

The inclusion of a Lookup Parameter Mapping upon an attribute causes the sort ordering of selected and saved values to show in order of the hidden key (usually a numeric ID) values instead. This is when the lookup contains references such as @where:param:user_def:string:somelabel@ and then this parameter 'somelabel' is mapped to another attribute value available to the object.

Steps to Reproduce:

  1. Admin Tool > Lookups Create a new lookup called mvlparamtest, set source to Dynamic Query, and Submit.
  2. Use the following NSQL to create the lookup.
    The configuration of the NSQL statement will automatically set the Hidden Key field to 'id' and the Name field to 'name' based on the NSQL Select field #1 and #2.
  3.        select,     from (       select '3' as name, 1 as id from dual       union all select '1' as test, 2 as id from dual       union all select '2' as test, 3 as id from dual       union all select 'b' as test, 6 as id from dual       union all select 'a' as test, 5 as id from dual       union all select 'c' as test, 4 as id from dual     ) v      where (@where:param:user_def:string:dummy_param@ is null or 1=1)     and @filter@   
  4. Create a new project attribute with these values and click Save:
      Name: mvlmapped  ID: mvlmapped  Data Type: Multi Valued Lookup  Lookup: mvlparamtest
  5. A new section appears: Lookup Parameter Mappings. Under Object Attribute ID select 'manager_id' and click 'Save and Return' button.
  6. Add the attribute to the Project Properties [Layout: Edit] view, section General.
  7. Main Application > Projects > Navigate to and select or create a project.
  8. Browse and select all values and click 'Add' button.
    Note: Items listed in the 'Browse Window' are sorted according to the configuration of the Browse Window properties defined on the Lookup Definition.

    Figure 1

    Before you click 'Save' on the project property subpage, you can see the values appear in the same order shown on the Lookup Browse Window.

    Figure 2
  9. Click 'Save' button on the project property subpage - now you will see the items are sorted differently.

    Figure 3

Expected Result: To see saved items sorted by name (a, b, c, 1, 2, 3)
Actual Result: Saved items are sorted by the internal ID (hidden key) value (3, 1, 2, c, a, b)


No workaround for displaying the items in a different order on the property subpage configuration.
However, if the field is placed on a List View, configured as a browse lookup, when the end-user clicks into the list of saved items, they are displayed in the order expected.

This issue has been documented as CLRT-41234.

Keywords: CLARITYKB, CLRT-41234, clarity13open, wnf, mvl