6

I have created a Platform event to create/update records in a custom object.I have written a trigger on the Platform Event in the after insert scenario.This platform event is called inside another custom object's trigger handler.I am able to successfully publish the event in my trigger handler.But my platform event is never fired.I have used correct debug levels ( both for user and Automated Process).

On further investigation, I found that under Subscriptions related list on the Platform event, the State of the trigger that I wrote on Platform event, is currently suspended.Ideally, the State should be Running so that the listener of the platform event is listening to events.

I checked on the Salesforce docs to find what Suspended State means.According to the documentation:

The trigger is disconnected and can’t receive events due to lack of permissions.

What do I need to do to make sure that the State changes to Running?

enter image description here

  • 1
    What is the profile of the user that created the Platform Event trigger? Do they have Read access under the "Platform Event Permissions" on the profile or an associated permission set? – Daniel Ballinger Mar 30 '18 at 8:35
  • @DanielBallinger the profile of the one who created it is System Administrator – Abhijeet Mar 30 '18 at 11:45
  • Also, on the profile level, the Read and Create Permission is already there for this Platform event – Abhijeet Mar 30 '18 at 11:50
  • Did you try to query 'EventBusSubscriber' object and see if you can update it through workbench? Alternatively you could clone your trigger to call the same Platform event and check if it changes from Suspended to Running? Unlike other configs, there isn't a place where you could restart a platform event from Suspend to Running. – Kumar Apr 1 '18 at 6:15
  • possibly related - salesforce.stackexchange.com/q/206577/2602 – cropredy Apr 2 '18 at 4:48
1

I was able to fix this issue by just editing the trigger, adding a whitespace and then saving it.It got back to the Running Status.This was really weird.I think a recompilation as cropredy mentioned , was needed.

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.