[SalesForce] Order of values in a multi-select picklist is not consistent

I added a value to a multi-select picklist field. Then I reordered the value to fit it in the list. After this I opened a record of this object and added this new value.

When looking at it in the Salesforce GUI it looks as I expect, i.e. it is located in the correct order. But when querying the field of this record the new value is located on the last position.

EXAMPLE:
This is the way it looks (number 64) in the Salesforce GUI
10; 20; 30; 40; 50; 64; 100; 200; 300; 400; 500; 600; 700; 800; 900; 1000

When querying the record the field value displays like this
10;20;30;40;50;100;200;300;400;500;600;700;800;900;1000;64

This is important since I use the values of this record as a key document for use in a portal. Any clue why this happens?

I have tried to clone the record, but no difference.

Regards / Niklas

Best Answer

As far as the database is concerned, the values were simply entered in the order they were created. What you've done is tell SF to change the order in which they're displayed in the GUI. That's why they query results will return the order in which they were created instead of the order in which you've told the GUI to display them. The query is simply querying the memory locations and not the GUI.

Related Topic