You need to sign in to do that
Don't have an account?
sonam
Soql with two in clause
I have to query from a custom object.
In the apex class i have to pass two lists as given below:
Select field1__c,field2__c , ,field3__c,field4__c,field5__c,field6__c,field7__c
From Object_custom__c where
field1__c in : List1 AND
field6__c in : List6
When I run the following query in developer console but it gives 'Unknown error parsing query'.
Select field1__c,field2__c , ,field3__c,field4__c,field5__c,field6__c,field7__c
From Object_custom__c where
field1__c in : ['Field1_value1,' Field1_value2'] AND
field6__c in : ['Field6_value1,' Field6_value2']
Here you are comparing with one field with a list of field using IN operator.
Do one thing create two List of of type of the data type of the field which you are comparing. Iterate two list with help of for loop.
add the field in set or list ,then compair those list or Set with IN operator.
You should check the query once, might be some other problem you have,
Use Debug Logs/Developer Console to track that Error
prem