You need to sign in to do that
Don't have an account?
Noodle
SOQL query with OR for picklist field
I have a trigger on a Parent Object_A to update records on a Child Object_B
I have a Set<ID> myID to get current record from Object A.
Object_B has a Picklist field Status__c.
List<Object_B> ToUpdate = [SELECT id, Name, Status__c from Object_B WHERE Status__c = 'Open' OR Status__c = 'Late' AND Object_B.Object_A in ;myID];
I would like to choose records that have the picklist value of EITHER Open or Late and where the lookup for Object A has the ID from my set myId.
It all works perfectly if I do Where Status equals one value. But I can't figure out how to say one value or the other.
Thanks in advance
I have a Set<ID> myID to get current record from Object A.
Object_B has a Picklist field Status__c.
List<Object_B> ToUpdate = [SELECT id, Name, Status__c from Object_B WHERE Status__c = 'Open' OR Status__c = 'Late' AND Object_B.Object_A in ;myID];
I would like to choose records that have the picklist value of EITHER Open or Late and where the lookup for Object A has the ID from my set myId.
It all works perfectly if I do Where Status equals one value. But I can't figure out how to say one value or the other.
Thanks in advance
Probably the easiest solution is to add in braces