Skip to content

SObjectStringFieldComparator

pozil edited this page Oct 20, 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<SObject>.sort()

Related

ListUtils


Constructors

SObjectStringFieldComparator(String fieldName)


Properties

fieldNameString


Methods

compare(Object o1, Object o2)Integer


Clone this wiki locally