On a custom sub object, an attribute with type Lookup - Number does not sort in the list view. The attribute is built off of a dynamic lookup in which it queries for the parent ID (odf_parent_id) and is mapped in the attribute properties parameter mappings to this ID. It seems that when it is not mapped to such an ID the sorting works fine. This is a sub object of the project object.
STEPS TO REPRODUCE:
SELECT DISTINCT @SELECT:INV.ID:ID@, @SELECT:INV.CODE:CODE@, @SELECT:INV.NAME:NAME@, @SELECT:INV.DESCRIPTION:DESCRIPTION@, @SELECT:INV.LAST_UPDATED_DATE:LAST_UPDATED_DATE@, @SELECT:'en':LANGUAGE_CODE@, @SELECT:1:LANGUAGE_ID@FROM inv_investments invJOIN odf_ca_project odf ON inv.id = odf.idJOIN inv_investments parentinv ON parentinv.code = odf.parent_idJOIN odf_ca_random_sub_object rel ON parentinv.id = rel.odf_parent_idWHERE (rel.odf_parent_id = @WHERE:PARAM:USER_DEF:INTEGER:PARENT_ID@
OR @WHERE:PARAM:USER_DEF:INTEGER:PARENT_ID@ IS NOT NULL)AND @FILTER@Expected Results: It should allow to sort on parameterized lookup.
Actual Results: It does not sort on parameterized lookup.
DE63768
Lookup query should be tweaked so that sorting works fine. Ideally param passed to query in where clause must be added within @BROWSE-ONLY: and :BROWSE-ONLY@.
Change the query as given below and sorting works fine in classic clarity and MUX.
SELECT DISTINCT @SELECT:INV.ID:ID@, @SELECT:INV.CODE:CODE@, @SELECT:INV.NAME:NAME@, @SELECT:INV.DESCRIPTION:DESCRIPTION@, @SELECT:INV.LAST_UPDATED_DATE:LAST_UPDATED_DATE@, @SELECT:'en':LANGUAGE_CODE@, @SELECT:1:LANGUAGE_ID@FROM inv_investments invJOIN odf_ca_project odf ON inv.id = odf.idJOIN inv_investments parentinv ON parentinv.code = odf.parent_idJOIN odf_ca_random_sub_object rel ON parentinv.id = rel.odf_parent_idWHERE 1=1 AND @FILTER@@BROWSE-ONLY: AND (rel.odf_parent_id = @WHERE:PARAM:USER_DEF:INTEGER:PARENT_ID@
OR @WHERE:PARAM:USER_DEF:INTEGER:PARENT_ID@ IS NOT NULL):BROWSE-ONLY@