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.
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:
- 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:
- 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:
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
Question
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)?
Best Answer
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.