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
Bill ButtonBill Button 

Trigger selecting using multi-select picklist

Hi,
 
When I try to do a select on a multi-select picklist I am getting an error as below, any help would be much apprietiated.
 

trigger TestingSyntax on Lead (before insert) {

for (Lead a : Trigger.new) {

 // the following gets no error but is not what I need.

Assignment__c AssignThis = [select Area_Account_Manager__c from Assignment__c where Country__c = :a.Country and brand__c = 'Edgecam'];

// the following causes the error "Save error: unexpected token: :"

//Assignment__c AssignThis = [select Area_Account_Manager__c from Assignment__c where Country__c = :a.Country and :a.brand__C in brand__c];

// or this alos get the same error.

//Assignment__c AssignThis = [select Area_Account_Manager__c from Assignment__c where Country__c = :a.Country and 'Edgecam' in brand__c];

}

}

Bill

micwamicwa
The syntax of the "IN" operator is wrong, first the fieldname and after the list:

List<Id> idList = new List<Id>();
idList.add(....);
.
.
[Select ... where Id in :idList].