[SalesForce] Consideration for Platform events in managed package

Here's the scenario:
We want to include one Platform Event called 'EventABC__e'

It will store record ids of any standard/custom object.
Then We will have a Subscriber trigger for that Event e.g.

// Trigger for catching EventABC__e events.
trigger EventABCTrigger on EventABC__e (after insert) {     
    // Iterate through each notification.
    for (EventABC__e event : Trigger.New) {        
        if (event.RecordIds != null) {
            /// do something here
        }
    }     
}

This setup will be part of managed package and we will push to Client's org (Even orgs on Professional or Group Edition)

Then within our managed package apex code we will Publish this event dynamically whenever needed and it should be handled by EventABCTrigger.

Would this approach work?

Best Answer

From the documentation, I'm inclined to think that the managed package can contain Platform Events but they just won't work in PE or GE orgs:

No Support in Professional and Group Editions
Platform events aren’t supported in Professional and Group Edition orgs, even if a package containing platform event objects is installed in the orgs.

I read that as not getting blocked on the install of the package.


I've reached out on the official success community channel for clarification.

Update

Official word from Jay Hurst (Director, Product Management)

The install should be blocked

So I interpreted the docs wrong and it isn't possible in PE or Group orgs.

Related Topic