Newer Version Available

This content describes an older version of this product. View Latest

Unsupported PushTopic Queries

The following SOQL statements are not 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 (formula fields are supported in SELECT clauses though.)
  • 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 IN phrase is supported in PushTopic queries.

    Note

  • 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

    TYPEOF is currently available as a Developer Preview as part of the SOQL Polymorphism feature. For more information on enabling TYPEOF for your organization, contact Salesforce.

    Note