I have created a lightning web component as a form to insert new cases.

I use this lightning web component inside a lightning community.

Inside my lwc I am using the lightning-record-edit-form component to show and update case field data.

enter image description here

The owner of the created case is set to the community guest user, and I need to change that user.

If I am using this component without changing the case ownerId, all works good.

Problem Problems appear when I try to change the ownerId:

  1. If I change the ownerId of the case in a case trigger, I get an Exception INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY = insufficient access rights on cross-reference id, and the record is not created:

enter image description here

  1. If I change the ownerId of the case in a process builder, I get an error: The requested resource does not exist, and the record gets created and even the ownerId got changed good, so I do not know why this error pops up and prevents my user from realizing that the case got created:

enter image description here

I have tried to give a lot of access on the guest profile, none helped me (especially when I though that it is access to the user object - this cannot be done)

I have tried to run this component not from a community - all works.

I have found a similar problem for the process builder error here: https://success.salesforce.com/answers?id=9063A000000a2A2QAI but the solution here is not my case


Can I change the ownerId of a case via lightning-record-edit-form in a community at all?

If I can - what is the right tool to do it with (trigger, workflow, process builder)?

  • Just give a try by giving 'Transfer Case' permission to guest profile. – Banshi Lal Dangi Sep 5 '19 at 1:29
  • @BanshiLalDangi there is no Transfer Case permission for the guest profile – Itai Shmida Sep 5 '19 at 6:36
  • 1
    Ok, so the only solution is to write an after insert trigger and then update the case record again with the new case owner Id. I know this is the bad solution but this is the only solution. Before Insert trigger will not work here. – Banshi Lal Dangi Sep 8 '19 at 11:10
  • In Winter 20 release, it seems to be possible to change owner. releasenotes.docs.salesforce.com/en-us/winter20/release-notes/… – Banshi Lal Dangi Sep 8 '19 at 11:12
  • Also you can use case assignment to assign the case owner. – Banshi Lal Dangi Sep 8 '19 at 12:05

We faced the same problem and this was related to Sharing Sets. The user submitting the case needs to have access to the case even after owner is changed to someone else or a queue.

Sharing set on Case Object - User:Contact = Case:Contact. We only provided Read Only access.

  • I have tried this now but I cannot find my guest profile, and according to this documentation: help.salesforce.com/… a guest profile cannot use sharing set. am I missing something? – Itai Shmida Nov 3 '19 at 13:55

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.