You need to sign in to do that
Don't have an account?
Vinay Temburnikar 7
What is the correct syntax to combine OR and AND in soql query?
Need a query that basically says
(ExposeCase = true OR CreatedByID = UserInfo.getUserId()) AND isClosed = false
which would be in the following syntax and sort of a combination of these:
soql += ' Where CreatedById = \'' + UserInfo.getUserId() + '\' OR Expose_Case__c = true';
soql += ' Where Expose_Case__c = true AND isClosed = false';
I am unable to figure out the syntax. I've tried the following
soql += ' Where CreatedById = \'' + UserInfo.getUserId() + '\' OR Expose_Case__c = true' + 'AND isClosed = false';
Using Dynamic SOQL
Using Static SOQL
I hope this helps.
All Answers
Using Dynamic SOQL
Using Static SOQL
I hope this helps.