function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

API 12 changes with SOQL query and the Id field?

Did something change between API 10 and API 12 relative to the use of the Id field in a SOQL statement?
select Id from User where SAP_Personnel_Number__c = '90000019' or Id = '90000019'
I have been running the SOQL statement above for several months under API 10 and it has been working fine. I started using API 12 and now I am getting an error when I execute this SOQL query:  "INVALID_QUERY_FILTER_OPERATOR"
Any ideas what this means, or how to work around it?   
The problem is that 90000019 is not a valid value for an Id, Under the 10.0 API, we'd let that query through even though the Id filter clause will never match, in more recent API versions we have it error out because the query was never doing what you thought it was doing anyway.
In this case, you can either remove the or id='...' clause, which would never match a row, or provide a real Id in the value.