- edited description
Cannot create a trigger (/subscriber) for an platform event
Reproducible by following the steps:
- Create a new trigger
- The menu opens where you can select the SObject type.
- Since there are now platform events, you can also create a trigger on a platform event, that works like it is a subscriber on that event. But you cannot select the platform event type in that select field.
Salesforce sample & documentation on this topic: https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_subscribe_apex.htm
Comments (6)
-
reporter -
repo owner Interesting. I thought I'd added full support for platform events as a variant of SObject, but guess I might have missed this aspect. I'll take a look. Thanks for reporting!
-
reporter Well the issue is solved by adding the platform event to the package.xml file and retrieving it first.
-
reporter - changed status to resolved
-
repo owner Hmmmm...that's odd. It should be using the SObjects in the OST to build the list of SObjects for creating a trigger. Did you happen to regenerate your OST in between as well? or perhaps save that
.object
file which would regenerate just that portion of the OST? -
reporter Yes you are right, i also needed to rebuild the OST. (only the SObject part, so it was quite fast)
- Log in to comment