Does List SObject .sort method implementation depend on version?

I believe that I have found very interested undocumented bug in Salesforce.

I don't see in the documentation saying that List.sort method implementation depends on version, but looks like it does. If one reads SFDC Documentation on List sort method here and here, one may get impression that for list of SObject records of the same type with different names, the sort method will always sort them by name disregarding the version of class where the sort method is called, but it is wrong impression.

In fact, if you moved a single line of code


from a controller class with version 37 to some DAO class of version 19 you may find that list of SObject records now are sorted in some wrong order. They are no longer sorted alphabetically by the name. If you call that method again in controller class with version 37, the records will be sorted correctly. Also if you change the version of DAO Class from version 19 to version 37, the records will be also sorted as expected.

I wonder why the implementation of sort method has changed?

Does anyone know in which order Salesforce sorts SObject records if using version 19?


Category: api Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.113 (s). 12 q(s)