Sorting in custom object list by field value | Community
Skip to main content
New Participant
May 27, 2020
Solved

Sorting in custom object list by field value

  • May 27, 2020
  • 1 reply
  • 2280 views

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)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

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 )

 

 

1 reply

SanfordWhiteman
New Participant
May 27, 2020

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

New Participant
May 28, 2020

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

Jay
SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 28, 2020

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 )