Support Article
Different sorting results on .pxRefObjectInsName
SA-9807
Summary
Two sections sort on .pxRefObjectInsName, but the sorting results are different.
This occurs when Work Order IDs have different number of digits (for example, OCD-1, OCD-2 and OCD-10).
Error Messages
Not Applicable
Steps to Reproduce
This situation occurs when Work Order ID have different number of digits.
Sorting low to high situation observed:
OCD-1
OCD-11
OCD-3
OCD-4
OCD-5
OCD-8
OCD-9
Expected sorting:
OCD-1
OCD-3
OCD-4
OCD-5
OCD-8
OCD-9
OCD-11
Root Cause
In the scenario where the identifier is sorting correctly it is because the design is such that you are not fetching the data from DB each and every time - you are keeping the data in a pagelist and then using that as a property in Repeat Grid layout which allows Pega-RULE:comparWorkIDs Rule-Utility-Function to work (it handles sorting for “TEXT-NUMBER” and “TEXT-NUMBER-TEXT”).
In the non-working case you directly obtain the data from DB each and every time, and the sorting is performed in the DB and the results of the database logic is displayed in the UI. This means that you have configured it so that you are fetching the data from the database through a Report Definition so that the entire data is sorted at the DB end and the sorted result set is posted in the UI by PRPC.
Resolution
Use the Repeating Grid with a pagelist populated by the same Report Definition to obtain correct sort results.
Published June 12, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.