Unsupported PushTopic Queries
These SOQL statements aren’t supported in PushTopic queries.
-
Queries without an
Idin the selected fields list -
Semi-joins and anti-joins
- Example query:
SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Contact WHERE Title = 'CEO') - Error message:
INVALID_FIELD, semi/anti join sub-selects are not supported
- Example query:
-
Aggregate queries (queries that use AVG, MAX, MIN, and SUM)
- Example query:
SELECT Id, AVG(AnnualRevenue) FROM Account - Error message:
INVALID_FIELD, Aggregate queries are not supported
- Example query:
-
COUNT- Example query:
SELECT Id, Industry, Count(Name) FROM Account - Error message:
INVALID_FIELD, Aggregate queries are not supported
- Example query:
-
LIMIT- Example query:
SELECT Id, Name FROM Contact LIMIT 10 - Error message:
INVALID_FIELD, 'LIMIT' is not allowed
- Example query:
-
Relationships aren’t supported, but you can reference an ID:
- Example query:
SELECT Id, Contact.Account.Name FROM Contact - Error message:
INVALID_FIELD, relationships are not supported
- Example query:
-
Searching for values in Text Area fields.
-
ORDER BY- Example query:
SELECT Id, Name FROM Account ORDER BY Name - Error message:
INVALID_FIELD, 'ORDER BY' clause is not allowed
- Example query:
-
GROUP BY- Example query:
SELECT Id, AccountId FROM Contact GROUP BY AccountId - Error message:
INVALID_FIELD, 'Aggregate queries are not supported'
- Example query:
-
Formula fields in WHERE clauses (But formula fields are supported in SELECT clauses.)
-
NOT- Example query:
SELECT Id FROM Account WHERE NOT Name = 'Salesforce.com' - Error message:
INVALID_FIELD, 'NOT' is not supported
To make this a valid query, change it to
SELECT Id FROM Account WHERE Name != 'Salesforce.com'.The
NOT INphrase is supported in PushTopic queries. - Example query:
-
OFFSET- Example query:
SELECT Id, Name FROM Account WHERE City = 'New York' OFFSET 10 - Error message:
INVALID_FIELD, 'OFFSET' clause is not allowed
- Example query:
-
TYPEOF- Example query:
SELECT TYPEOF Owner WHEN User THEN LastName ELSE Name END FROM Case - Error message:
INVALID_FIELD, 'TYPEOF' clause is not allowed
- Example query:
-
Roll-up summary fields. If a PushTopic query contains a roll-up summary field for an object, notifications aren’t be sent for changes (create, update, delete, and undelete) in that field.