Sorting by Picklist Items in a Grid Control

Posted by IramK on 13-Aug-2015 08:38


I have two objects A and B and they both are related to each other A-B(1-M) and I am using a grid control for B in the New/Edit Pages of A. I have a picklist field in object B with country values like Armenia, Aland, United Kingdom etc. I have selected the option of sorting in ascending order on this grid but every time I try to edit record A, the sort order changes and doesn't show me in the correct sort order i.e. Aland -> Armenia -> United Kingdom. Is there an existing issue with sorting in a Grid Control? I am on version Private Cloud.


All Replies

Posted by Mani Kumar on 14-Aug-2015 05:25

Hi Iram,

I've tested this on the latest build and I see that even after editing the record of Object A, the sorting on Object B's grid record is maintained.

Can you please share the Screenshot or the sample application xml to troubleshoot further.



Posted by IramK on 17-Aug-2015 08:10

Hello [mention:ce2116fd258e46ee8b4509379c9663a4:e9ed411860ed4f2ba0265705b8793d05] ,

I have attached screenshots for the scenario I have described.

View Page (Correct):

Edit Page Sorting (Wrong): (3 different sorting orders on refresh)

Grid Control Settings:

Kindly let me know as to what am I doing wrong here.


Posted by IramK on 19-Aug-2015 05:46

Any suggestions on why this is happening?

Posted by Karthikeyan Bhaskaran on 19-Aug-2015 08:32

I too tried a similar scenario in the Rollbase version 3.2.4, but could not see this problem.

Can you attach records and share the application xml?

Posted by IramK on 19-Aug-2015 08:35

Hello [mention:1ad0ccbca98f4ef2ac88293a48e6d67d:e9ed411860ed4f2ba0265705b8793d05] ,

I am on version Would you think this would've been fixed in version 3.2.4?

Posted by IramK on 19-Aug-2015 08:55

Ok I found the issue. So basically if you see from the attached picture of the Grid Control settings that says "Lookup Options" and it shows "Use List View : All Countries" and my All Countries already has sorting applied on the list View sorting it by Country in Ascending order. Now when I try to apply it on the Grid Control in the Edit Page, I think it is trying to perform the sorting again and getting confused. I'm thinking this is possibly a bug because regardless of setting it on the List View and/or grid control, it should sort it in the ascending order. Any suggestions on why this is happening?

Posted by Mani Kumar on 19-Aug-2015 08:55

Hi Iram,

I've tested the same on 3.2 build and it works fine for me.

As per Karthik's suggestion, can you please share the app.xml (Please seed records of both the objects before exporting the app xml).



Posted by Karthikeyan Bhaskaran on 20-Aug-2015 04:52

Hi Iram,

After repeated tests, one situation where I could see the odd sort order was if the original picklist itself did not use Alphabetical Sorting when assigning it default values. But, I could not see variation across pages.

For my test, I had initially set up values such as Armenia, Bhutan, China, Denmark and Ecuador with "Sort values alphabetically, not in the order entered". (Everything was in alphabetical ascending order independent of the order I choose.)

Then, I added "Chile" to the list and unchecked the box "Sort values alphabetically". After this, everytime I had data that involved Chile, China, the resultant grid showed incorrectly sorted records, even though the Sort indicator was "ascending" on my "countries" column. Does this ring similar to your configuration of picklist values?

In your screenshots I see that the sort arrow is Ascending on Countries but the actual listing appears different and has no order. Can you also share the screenshots of the complete pages? Or, if possible, your app xml with some data?



Posted by IramK on 24-Aug-2015 06:03

Hello [mention:1ad0ccbca98f4ef2ac88293a48e6d67d:e9ed411860ed4f2ba0265705b8793d05] ,

I forgot to mention that the countries picklist is basically a related field to a country object that contains the list of the countries with the country name as the record name so the alphabetical sort order does not matter in this case. If you notice in the screenshot I have specified under the lookup options that the country lookup is being used as a picklist and I am using a particular list view from the country. However as mentioned before in my previous post, I have managed to find out the issue but I just don't know if that is how it is supposed to behave.

Posted by Karthikeyan Bhaskaran on 26-Aug-2015 09:36

Will it be feasible for you to share your app xml and some seed data? It will be extremely helpful for the investigation without having to resort to guesswork- what I have shared is only one scenario. You could also open a Support case and attach the xml to the case, if that is an acceptable alternative.

Posted by IramK on 26-Aug-2015 10:38

Hello [mention:1ad0ccbca98f4ef2ac88293a48e6d67d:e9ed411860ed4f2ba0265705b8793d05] ,

Yes sure. I have created a test application and attached it to this post that behaves in the same way as mentioned in my post. So if you go to the edit page that contains the grid control for "Adjustment Tests", you'll notice that the Ascending sort order of grid list items keep shuffling on refresh where as on the view page of "Group Tests", the related record list has the correctly sorted list of countries.[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/25/Groups-Test_5F00_v1.xml:550:0]

Posted by Karthikeyan Bhaskaran on 28-Aug-2015 02:16

Hello Iram,

I could not locate any fields other than the related field(s), in both objects. Something seems to be missing.

Please let us know also, which database are you using.

This thread is closed