3

In a single record, a user selects multiple values from a multi-select picklist. How are the selected values represented in Apex?

  • 1
    Anzar, you know you could have simply created a multi-select picklist field in your org, populated it, and then queried for it using the Developer Console to figure this out – cropredy Dec 28 '15 at 21:52
  • 1
    Yep @cropredy. I tried that out and found the selected multiple values are separated by semicolons. "Value1;Value2:Value3" – MnZ Dec 16 '16 at 4:16
10

A string with the selected values separated by a semicolon:

Account fruitVendor = [SELECT Fruits_Sold__c FROM Account WHERE Name = 'I Sell Fruits'];
System.debug(fruitVendor.Fruits_Sold__c);

15:11:33:027 USER_DEBUG [2]|DEBUG|Apple;Banana;Orange;Grape

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.