You need to sign in to do that
Don't have an account?
srikanth gubbala 1
How to i check if a multi picklist is having a following value or not in apex coding
Example:-
Set<id> AccIdList = new Set<id>();
List<Account> accountsToUpdate = new List<Account>();
List<String> conNames = new List<String>();
for(Contact con : contacts){
if(con.PartnerDesignation__c== 'Principal'||(con.PartnerDesignation__c!=oldMap.get(con.Id).PartnerDesignation__c && con.PartnerDesignation__c!='Principal')){
AccIdList.add(con.accountid);
}
}
This works fine if multipicklist is having only one value but ifts having picklist "Princpal" and "Secondary" its not working
Set<id> AccIdList = new Set<id>();
List<Account> accountsToUpdate = new List<Account>();
List<String> conNames = new List<String>();
for(Contact con : contacts){
if(con.PartnerDesignation__c== 'Principal'||(con.PartnerDesignation__c!=oldMap.get(con.Id).PartnerDesignation__c && con.PartnerDesignation__c!='Principal')){
AccIdList.add(con.accountid);
}
}
This works fine if multipicklist is having only one value but ifts having picklist "Princpal" and "Secondary" its not working
you can use contains method.
try with below code.
If this helps, Please mark it as best answer.
Thanks!!
All Answers
you can use contains method.
try with below code.
If this helps, Please mark it as best answer.
Thanks!!