SOQL Error and Functionality Changes in this release can impact existing Apex code that relies on old SOQL error messages and functionality, particularly to dynamic SOQL code that handles the parsing of error messages. Apex code should be updated according to the new changes as needed
- Support for negative currency values in queries, such as SELECT Name FROM Invoice__c WHERE Balance__c < USD-500
- New error messages with invalid SOQL queries
- SELECT Id FROM Account USING everything
Old: unexpected token: ‘<EOF>’
New: unexpected token: ‘everything’ - SELECT ParentId, Value FROM InteractionRefOrValue WHERE ParentId IN ()
Old: unexpected token: ‘)’
New: unexpected token: ‘ParentId IN ()’ - SELECT FROM ServicePresenceStatus
Old: unexpected token: ‘FROM’
New: unexpected token: ‘SELECT FROM’ - SELECT Id from $casecomment WHERE isdeleted = false
Old: line 1:15 no viable alternative at character ‘$’
New: line 1:15 unexpected token: ‘$’ - SELECT lastmodifieddate, companyna fr$om user
Old: unexpected token: user
New: missing value at ‘user’
- SELECT Id FROM Account USING everything
- New error message in SOQL queries with quotes surrounding an unexpected token
SELECT annualrevenue , parentid
FROM Account
WHERE
(isDeleted = false AND NumberOfEmployees != 100)
OR (isDeleted = false AND Site = ‘999’)
AND ParentId = ‘000000000000000’ LIMIT 50000
Old: unexpected token: AND
New: unexpected token: ‘AND’ - New error message when using NULL literals in WHERE statements with the LIKE keyword
SELECT Id, Name, Country__c, State__c, City__c, PAN_Number__c
FROM Account WHERE PAN_Number__c LIKE NULL AND Name LIKE ‘%a%’
Old: invalid operator
New: unexpected token: ‘NULL’ - New error message when using more than two nested functions
SELECT convertCurrency(calendar_year(convertTimezone(lastmodifieddate))) FROM account
Old: expecting a right parentheses, found ‘(’
New: unexpected token: ‘(’ - New error messages in SOQL queries with invalid datetime literals
- SELECT Id FROM Account WHERE SystemModstamp > 2020-12-12t12:12:00-25:00
Old: line 1:67 mismatched character ‘5’ expecting set ‘0’..’3′
New: Invalid datetime: 2020-12-12t12:12:00-25:00 - SELECT Id FROM Account WHERE SystemModstamp > 2020-52-12t12:12:00-05:00
Old: line 1:51 no viable alternative at character ‘5’
New: Invalid datetime: 2020-52-12t12:12:00-05:00
- SELECT Id FROM Account WHERE SystemModstamp > 2020-12-12t12:12:00-25:00
- New error message when there isn’t a valid bind variable reference after a colon
SELECT Id FROM Custom_User_Attribute__c WHERE User__c =: 0050W000007Jz7jQAC
Old: Only variable references are allowed in dynamic SOQL/SOSL
New: unexpected token: ‘0050’