2

I would like to use the streaming api for the following use case,

"When a case is closed the complete object should be published. Case object contains more than 700 fields'

After a quick investigation, it seems there are different options:

  1. Change data capture (CDC). No valid because we can not add rules (case is closed)
  2. Pushtopics. SOQL with no more 1300 characters...in this case we have 700 fields
  3. Platform Events. I think this is the best solution creating one platform event with only one field (payload) and populate it with a json that contains all the case fields. The problem could be if the payload length is more than the platform event length field. Create 700 fields in the platform event is insane.

What do you think? One of this options or another one?

Thanks

6
  • 1
    What about pushing only record Id, and then doing fetch of all the fields based on record id from client side?
    – kurunve
    May 9, 2020 at 18:19
  • yeah, that's another valid option, but then we need to execute one api call per record Id...increasing the number of daily api calls.. May 9, 2020 at 18:34
  • What's a real-world use case that is going to require all 700 fields?
    – identigral
    May 9, 2020 at 20:05
  • Don’t ask...hahaha May 9, 2020 at 20:06
  • If you need some sort of replication, consider using the replication api methods getUpdated and getDeleted. From there, it's a simple matter of using retrieve calls to get up to 2k records at once with all the fields, all for the cost of a single API call.
    – sfdcfox
    May 10, 2020 at 8:45

0

Browse other questions tagged .