0

We are implementing Communities in our project and as part of its functionality, the community user submits a form and as a result of this submission:

  1. An Account record needs to be created
  2. Account Ownership should be changed from Community User to a different user
  3. The community User should regain access to the same Account but with just Read access.

The Account record creation happens in apex code. On Account object, we have a process builder with an action that changes OwnerId to different user id and another action in the same process builder to call a Flow to insert Account share record for the community user to get read access to the account.

But when the community user is submitting the form, the following exception is thrown:

This error occurred when the flow tried to create records: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY: insufficient access rights on cross-reference id.

OWD Sharing : Default Internal Access is Public Read Only and Default External Access is Private. Flow is set to run in System Context.

Please let us know if we are missing something here.

Thanks. [Edited]

  • 2
    Please edit your post to include more details. What is the OWD sharing on Account? If Private for external users, then the account may not be visible to the user after the ownership change. Is your Flow is set to run in user context or system context? – David Cheng Apr 17 at 15:11
  • Added details in my post – Suha Apr 18 at 4:31
0

If you are using Customer Community licenses, your community users cannot create accounts, they only have read and edit access (see license detail section here). If that is the case, your best shot would be create a custom object e.g. Comm_Account_Proxy with all the fields you need to gather for the Account creation (for which you'd give the community user profile create access to). Your community form will allow the user to create a record of such custom object and then you'd use process builder to create the Account from this proxy record.

| improve this answer | |
  • They have Customer Community Plus Login license and their profile has Account Create access so they are able to create account record. I guess the exception is during accountshare record creation – Suha Apr 17 at 14:47
  • Did you try apex code using 'without sharing '? – Jaya Apr 19 at 9:30

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.