Pages

Tuesday, September 30, 2014

Salesforce: How to sort Multi-Select Picklist in View ?

Multi-Select Picklist is a great feature for user to select multiple values controlled. You can use the multi-picklist field in View, Report, etc.

Recently we have issue when used it in View, user not able to sort b value using this multi-select picklist field. A quick idea is to create a text formula field, but looking at multi-select picklist fields can only be used in these functions: INCLUDES(), ISBLANK(), ISNULL() for formula field, TEXT() is out of picture here.

ISCHANGED() and PRIORVALUE() only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited.

Solution:
Create text formula field with INCLUDES()
Example:
 IF( INCLUDES( Country__c, 'Singapore'), 'Singapore',  
     IF( INCLUDES( Country__c, 'Australia'), 'Australia',  
         IF( INCLUDES( Country__c, 'Malaysia'), 'Malaysia',  
             IF( INCLUDES( Country__c, 'Thailand'), 'Thailand',  
                 IF( INCLUDES( Country__c, 'Hong Kong'), 'Hong Kong', 'Other')  
             )  
         )  
     )   
 )   

Cons: when you have multiple values in the field, it will return based on the first value match.


ReferenceTips for Working with Picklist and Multi-Select Picklist Formula Field