0

How about this below I called this class method from a trigger providing a string value to it, which is same as User's service segment field ( a multi select picklist). but I am getting an error in this line:Service_Segment__c includes leadServiceSegment . The error is expecting a left parentheses, found 'leadServiceSegment'. How to go about it.

public void leadOwners(string leadServiceSegment){
    list<user> bdeOwners = [Select ID, Name, Related_Team__c, service_segment__c,ComplianceServices__c, Registration__c, IPR__c, ISO__c 
                                            from User 
                                                where 
                                            (ComplianceServices__c = true
                                              OR
                                             Registration__c = true
                                             OR
                                             IPR__c = true
                                             OR
                                             ISO__c = true)
                                            AND
                                            **Service_Segment__c includes leadServiceSegment**
                                            AND 
                                            isActive = true 
                                            AND 
                                            On_Leave__c = false 
                                            ORDER BY name desc];

}

2

I think you just need to but a ':' before the variable reference and put brackets around it.

ie using your code

...
OR
ISO__c = true)
AND
  Service_Segment__c includes (:leadServiceSegment)
AND 
isActive = true 
...
  • Superb, you are absolutely right Stuart. Thanks a lot. – Rohit Mar 29 '14 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.