I had a Contact Support Form on a community that allows users to create a case for a customer. This form contains customer contact information (email, name, phone, etc). Currently, if there is not a contact match in our system, when the case is created, the Contact associated with the Community User is being linked to the Case by default.
Override in Trigger: I tried basically nulling out the contact in the Case trigger based on certain criteria that would isolate this type of case. This did not work--no matter what context I set the contact to null at, the Contact for the case was eventually reassigned to the Community User (i.e. the cases creator).
Override in Process Builder: Similar to my attempt in the trigger, I added logic in a process builder to isolate this specific type of case on creation, and attempted to null the contact assignment there, but the Contact of the Community User still ended up getting assigned.
Custom Component: I created a custom lightning web component that creates a case. I originally thought this was working when I tested via the community builder. However, when I tested as a logged in community user the user contact still linked. I tried the following submission mechanisms:
a. I submitted and created a case via lightning-record-edit-form's submit. This does not work.
b. I linked my lightning web component to an apex class controller, and created and inserted the case via apex. This also does not work
- Is it possible to prevent this default behavior of linking Community Users as the contact for cases they've created when there is no contact match?
- Are there ways to avoid this via apex?
- Is there some checkbox or setting I am missing?
- Is there a way to prevent this behavior directly on the Contact Support Form?
- Any other ideas of how to resolve this?
Also note: this is a Customer Community Plus User.