SOLVED

Sorting in custom object list by field value

Go to solution
Jay00031987
Level 3

Sorting in custom object list by field value

In CO list,  field-A is having two value and what can be conditional statement to sort the CO list by field value only? 

Custom objects(co_c), field-A(fieldA) and value of field-A is (val1, val2)

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Sorting in custom object list by field value

case-insensitive alphabetical 


If the list is $myList, and the String property to sort by is myProperty, then

 

#set( $mySortedList = $sorter.sort( $myList, ["myProperty"] ) )

 

 


- counter running minimum 3


 

#if( $myList.size() < 3 )

 

 

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Sorting in custom object list by field value

Can you be more specific about what kind of sort (case-insensitive alphabetical, numeric)?

Jay00031987
Level 3

Re: Sorting in custom object list by field value

Hi San,

Below is the specific requirement

case-insensitive alphabetical 

- counter running minimum 3

- if counter is less than 3 it should print default value

SanfordWhiteman
Level 10 - Community Moderator

Re: Sorting in custom object list by field value

case-insensitive alphabetical 


If the list is $myList, and the String property to sort by is myProperty, then

 

#set( $mySortedList = $sorter.sort( $myList, ["myProperty"] ) )

 

 


- counter running minimum 3


 

#if( $myList.size() < 3 )

 

 

View solution in original post