Newer Version Available
Unsupported PushTopic Queries
These SOQL statements aren’t supported in PushTopic queries.
- Queries without an Id in 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
- 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
-
COUNT
- Example query: SELECT Id, Industry, Count(Name) FROM Account
- Error message: INVALID_FIELD, Aggregate queries are not supported
-
LIMIT
- Example query: SELECT Id, Name FROM Contact LIMIT 10
- Error message: INVALID_FIELD, 'LIMIT' is not allowed
- 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
- 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
-
GROUP BY
- Example query: SELECT Id, AccountId FROM Contact GROUP BY AccountId
- Error message: INVALID_FIELD, 'Aggregate queries are not supported'
- 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'.
-
OFFSET
- Example query: SELECT Id, Name FROM Account WHERE City = 'New York' OFFSET 10
- Error message: INVALID_FIELD, 'OFFSET' clause is not allowed
-
TYPEOF
- Example query: SELECT TYPEOF Owner WHEN User THEN LastName ELSE Name END FROM Case
- Error message: INVALID_FIELD, 'TYPEOF' clause is not allowed
- 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.