Cannot create a trigger (/subscriber) for an platform event

Issue #843 resolved
Theodoor van Donge created an issue

Reproducible by following the steps:

  1. Create a new trigger
  2. The menu opens where you can select the SObject type.
  3. 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)

  1. Scott Wells 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!

  2. Theodoor van Donge reporter

    Well the issue is solved by adding the platform event to the package.xml file and retrieving it first.

  3. Scott Wells 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?

  4. Theodoor van Donge reporter

    Yes you are right, i also needed to rebuild the OST. (only the SObject part, so it was quite fast)

  5. Log in to comment