function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Artem Kalus 7Artem Kalus 7 

lightning-record-edit-form Unable to find the record referenced by (ObjectName).OwnerId in null:

I have a publicly available page through salesforce sites. It was working before our sandbox got upgraded to Spring 2020 release. In order to replicate the problem a salesforce site needs to be created. The LWC will be embedded within salesforce site VFP.

I gave the external user access to Case object (read/edit) and visibility of fields to be displayed.

I get identical issue with aura component "lightning:recordEditForm" and LWC "lightning-record-edit-form".

I could replace the lightning-record-edit-form with input fields, however, it makes things complicated with dependent picklists.

<apex:page standardStylesheets="false" applyBodyTag="false" sidebar="false" showHeader="false">
    <apex:includeLightning />
    <div id="container"></div>
    $Lightning.use("c:Site_LWC_Viewer_App", function()
            console.log('component created');

AURA APP - "Site_LWC_Viewer_App":
<aura:application extends="ltng:outApp" access="GLOBAL" implements="ltng:allowGuestAccess">

LWC - "testLWC":
    <lightning-record-edit-form object-api-name="Case">

        <lightning-input-field field-name="Subject"></lightning-input-field>
        <lightning-button   class="slds-m-top_small"
                            label="Create new">

Error Message
Best Answer chosen by Artem Kalus 7
Artem Kalus 7Artem Kalus 7
This got resolved a few weeks later after sandbox refresh.

All Answers

Artem Kalus 7Artem Kalus 7
This got resolved a few weeks later after sandbox refresh.
This was selected as the best answer
Gurditta Garg 16Gurditta Garg 16
Artem Kalus 7 - Did you find the root cause of this??
Dan VegaDan Vega
I'm having this same error message on creating a custom object - appears when "new" is clicked to create a new record.  The user has create rights. Have a ticket open with salesforce support.
Jesse RoweJesse Rowe
I'm also seeing this. Does anyone have a solution?
Jesse RoweJesse Rowe
I got around this issue by defaulting a value for ownerId to another user in the organization. I'm using e.force:createRecord and setParams to default to a different user.