Skip to content

SObjectStringFieldComparator

albarivas edited this page Nov 23, 2021 · 10 revisions

layout: default

SObjectStringFieldComparator class

Comparator that lets you sort a list of SObject alphabetically based on a String field. @example ListUtils.sort(accounts, new SObjectStringFieldComparator('ShippingCountry')); Tip: don't use this to sort by Name as SObjects are already sorted by Name by default when calling List.sort()

Related

ListUtils


Constructors

SObjectStringFieldComparator(String fieldName)


Properties

fieldNameString


Methods

compare(Object o1, Object o2)Integer


Clone this wiki locally