You need to sign in to do that
Don't have an account?
Rajendra Prasad 44
here "Campaign_new__pc" is Multi select Picklist field.
need help for - nested for loop
how to avoid for loop in for loop here
for(account a: accounts){ string[] perCamps = a.Campaign_new__pc.split(';'); for(integer i=0; i<perCamps.size(); i++){ if(!conIdByCamName.containsKey(perCamps[i])) conIdByCamName.put(perCamps[i], new list<string>{a.PersonContactId}); else conIdByCamName.get(perCamps[i]).add(a.PersonContactId); }
here "Campaign_new__pc" is Multi select Picklist field.
Greetings!
Please refer the below thread for the example code which will help you in making changes according to your code.
https://developer.salesforce.com/forums/?id=906F0000000kEXaIAM
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri