Thursday, August 24, 2017

How to Use Like With Lists and Sets In SOQL Queries

//Possible options we're going to query for.
Set<String> voiceMailOptions = new Set<String>{'%voicemail%', '%voicemali%', '%vm%','%message%'};
List<Task> tsks = [select Id, Call_Result__c from Task Where Call_Result__c LIKE :voiceMailOptions];
for (Task tsk : tsks) {
 doSomething(tsk);
}

No comments:

Post a Comment