2

I've got a very simple Platform event published by Apex code, and a subscribed Process Builder receiving it.

Transcript_Request__e patEvt = new Transcript_Request__e();
patEvt.Enrollment_Id__c = 'a0803004000VyFZAA5';
Database.SaveResult sr = EventBus.publish(patEvt);

Process Builder fired upon Platform event dispatch by Salesforce Internal user.

But when I dispatch Platform event as Community user, It doesn't seem to run. I can see following success message in Community user debug log.

20:43:16.0 (32893554)|VARIABLE_SCOPE_BEGIN|[16]|sr|Database.SaveResult|true|false 20:43:16.0 (32955631)|VARIABLE_ASSIGNMENT|[16]|sr|{"success":true,"id":"e00xx0000000001AAA","errors":[{"status":"OPERATION_ENQUEUED","message":"7af7599b-04f9-49c3-8 (16 more) ..."}]}|0x5fcca34d

And Database.SaveResult.Errors has one record with below:

20:43:16.0 (33820259)|VARIABLE_ASSIGNMENT|[21]|err|"Error [statusCode=OPERATION_ENQUEUED, code=[xmlrpc=-1, statusCode=OPERATION_ENQUEUED, exceptionCode=null, scope=PublicApi, http=202], message=7af7599b-04f9-49c3-897a-dacf6bbc9c81, fields=null]"|0x206cef35

Seems we can't query EventBusSubscriber as Communtiy, therefore I'm assuming we can't publish Platform events.

enter image description here

Any thoughts if Platform Events are supported for Customer Community or Customer Community Login users?

I couldn't find any Docs which says it's not supported.

If not supported, is there any workarounds to use them in Community? e.g. publish using apex, consume by Process Builder.

1 Answer 1

1

Platform events are supported with community licenses, so I don't think this is your issue.

Could well be something else in the transaction that is causing the failure and rollback including the platform event. How are you triggering the platform event as a community user?

3
  • Thanks for your answer @Andrew, It's the same Apex code simply called from a Aura component invoking AuraEnabled Apex method. I don't see process builder invoked in community user's debug logs. My colleague suggested me this could be because of trailblazer.salesforce.com/ideaView?id=08730000000DnN8AAK. Mar 23, 2021 at 23:30
  • Since you are using Platform Events rather than Push Topic Events, this shouldn't be the problem. We have community users creating platform events in our Org so am sure it's possible! Have you checked the community user's profile has Apex Class access? Does the class run without sharing? See if that helps.
    – Andrew
    Mar 28, 2021 at 18:14
  • I did debug the autoproc and it seems running. Thanks!, Noted we can't assign permission sets with VF page access to autoproc user. Therefore I had to go with scheduled batch where context user will have permission set with vf access. Apr 20, 2021 at 5:31

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.