Skip to main content
vinod fnu (ttsd) ๋‹˜์ด #Apex์— ์งˆ๋ฌธํ–ˆ์Šต๋‹ˆ๋‹ค
i am trying to write a test class to cover a multipicklist field.

i am not able to pass the multiple value using apex.
๋‹ต๋ณ€ 5๊ฐœ
  1. 2024๋…„ 4์›” 1์ผ ์˜คํ›„ 3:04

    For anyone who needs to assign a Set or List of strings to a multiselect picklist you can use String.join(listOfString, ';')

    Example:

    List<String> listOfMultipicklistValues;

    // assign to a multipicklist field

    sObject.multiPickField__c = String.join(listOfMultipicklistValues, ';');

    // FYI: String.join() method will merge the elements in the list and separate them with the separator in the second parameter

0/9000