Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use "OR" function #138

Closed
girlyITgeek opened this issue Mar 16, 2015 · 4 comments
Closed

Cannot use "OR" function #138

girlyITgeek opened this issue Mar 16, 2015 · 4 comments

Comments

@girlyITgeek
Copy link

See my relationship criteria below.

(status__c IN ('Active', 'Active - pending end') AND avtrrt__start_date__c != THIS_WEEK) OR (status__c IN ('Active', 'Active - pending end') AND avtrrt__end_date__c = LAST_WEEK)

Error: Relationship Criteria '(status__c IN ('Active', 'Active - pending end') AND avtrrt__start_date__c != THIS_WEEK) OR (status__c IN ('Active', 'Active - pending end') AND avtrrt__end_date__c = LAST_WEEK)' is not valid, see SOQL documentation http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm, error is 'unexpected token: OR'

@aheber
Copy link
Contributor

aheber commented Mar 17, 2015

@girlyITgeek I tested your criteria, adapted to my own org, inside the Developer Console and it ran OK.

select id from case where (status IN ('New', 'Closed') AND CreatedDate != THIS_WEEK) OR (status IN ('New', 'Closed') AND CreatedDate = LAST_WEEK)

Could you write something similar that will run OK in your Developer Console, or another SOQL tool, and paste it back here with screenshots of your rollup? I don't know what could be wrong but maybe we'll figure it out by seeing the whole picture.

Thanks.

@wes1278
Copy link
Contributor

wes1278 commented Mar 17, 2015

I think you might need to wrap the whole thing in another set of parentheses.

@girlyITgeek
Copy link
Author

Thank you wes1278!!! That worked.

@wes1278
Copy link
Contributor

wes1278 commented Mar 17, 2015

No problem @girlyITgeek! Glad it works. @aheber, SOQL is a little smarter when it's not being injected from a string like we're doing with this tool. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants