0

Is it possible to setup a push topic to monitor all columns in a table?

e.g. use the SOQL query SELECT * FROM Account or SELECT Id, * FROM Account

When I try this I get the following error which would indicate not, but I cannot see any restriction documented in the Push Topic documentation.

Error Updating Push Topic: unexpected token: '*'

I tried specifying all the column names but that breaches the 1300 character constraint of the SOQL query.

  • 1
    I would strongly consider what fields you want to track rather than tracking every last one of them before going forward with this design. That being said, if you were to track the LastModifiedDate field that field updates with any and all changes to an SObject in Salesforce so that way you would be alerted of an update to an Account. – nbrown Feb 11 at 16:05
  • Makes sense @nbrown, I'll try that. – Eoin O'Hehir Feb 13 at 9:42
3

Queries for Push Topics are standard SOQL and that they should follow the SQOL syntax and limitations. There are some statements in SOQL which are not supported for Push Topics. Asterisk (*) is not a valid character in SOQL and thus you are getting that error.

As for SOQL limits, the maximum character limit for a SOQL is 20,000 characters. As long as you can accommodate the columns within these character limits, and if you are not using the unsupported statements, you can achieve what you are looking for. If your query exceeds these limits, then you can't. From a design perspective, ideally you should not be looking to subscribe for all fields on an object. This could easily become a bottleneck as you are already experiencing and that it deviates from the intent of Push Topics. You don't really transfer all data with Push Topics but only what is relevant.

While I am not completely sure about your use case, but I will recommend that you also take look at Change Data Capture. Using Change Data Capture, you can subscribe to objects and that whenever a field value changes, you will always be able to get the value of that particular field. That way you will not have to maintain specific fields which you need to subscribe.

  • Thanks @Jayant Das. I'm new to Salesforce to this helps a lot. I'll have a a look at CDC. – Eoin O'Hehir Feb 13 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.