Skip to main content

Posts

Showing posts with the label expecting a left parentheses

How to use includes operator in query filter ?

Hi All, It has been a long time, there is no post in salesforce4u, I am apologizing for being so late, now I am assuring you, there will be at least one post in each month. We will start with the simple one, Last week I faced one query exception " expecting left parentheses, found ': '",  Let me share how did I resolve that issue. The requirement was just filtering records using multi-select picklist values. What exactly will come to a developer mind ??  Use the following operator to accomplish. 1. LIKE - It will be used for normal string/text field filter and it's a partial match. 2. CONTAINS - It is not being used at all in SOQL 3. INCLUDES - This is the best one to use for this requirement. How to use INCLUDES operator in the SOQL query. Below is the code snippet to filter Account based on value  (  'Agriculture','HR'  ). Static Querry List<Account> accList = [Select id,name,LOB__c from Account where LOB__c  ...