I Have a Picklist Field Like (Orderstatus__c) Field, Values are (A, B, C, D, E, F) This Picklist Field, when i am querying the Orderstatus__c Filed Those values will be displaying like Un order (B, E, C, D, A, F).

  • 1
    So, what is your question? Can you make it more clear? – sanket kumar Oct 11 '18 at 17:50

SOQL, Apex and API access on these fields will however return the values in their created order via Setup or deployment. Similar to when using ORDER BY in SOQL with regards to Picklist fields - "sorting is defined by the picklist sort determined during setup".

Multi-Select Picklist Value ordering behavior

  • Please do not post link only answers as the links often break. See How to Answer – Dave Humm Oct 11 '18 at 10:00
  • That is not correct... i have 100 Records, first 20 records Orderstatus__c Field Value is 'A' , second 21 to Remaining 50 records, Orderstatus__c Field value is C, and another remaining record values display.... – ali Oct 11 '18 at 14:06
  • As a test I added a new multi select pick list with the following values in this order. The initial 3 picklist values were added at creation and the following 4 at a later time: Values API Name A A M M X X B B Q Q Z Z Y Y I then selected values on two different objects in a random order Record1.Test__c = M;X Record2.Test__c = A;M;X;B;Q;Z;Y So here it looks like the creation order. I've I re-order the picklist values to be alphabetical I still get the same result, even after edit the records: Record1.Test__c = M;X Record2.Test__c = A;M;X;B;Q;Z;Y – Dan Beer Oct 12 '18 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.