function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RajashriRajashri 

How to retrieve and split the values of multiselect picklist

Hi,

I have  custom object in Salesforce name  'Project' and It has a Picklist Field 'Proj Implementation' Type.

and my second custom object is name 'SEC' and it has picklist(Multiselect) field name 'SEC DD'.

I want to compare if  value of 'Proj Implementatuon Type' equals to 'SEC DD' then add some records.

 

How can i do this comparison?

 

also How to retrieve and split the values of multiselect picklist to achieve the result?

 

Can anyone plz send me code?

 

Thanks

Rajashri

Rajesh_ShahRajesh_Shah

Is 'Proj Implementation' field a picklist or multipicklist? If it is a picklist, then you are essentially checking if SEC DD contains the value of Proj Implementation. You can do this using the contains function of String Eg. Boolean res = String1.contains(string2).

 

For splitting multipicklist value, you can use the split function of String. Eg: String[] picklistValues = Sec_DD_String.split(';');