How to expose lighting record edit form on salesforce site

90 Views Asked by At
<lightning-record-edit-form object-api-name="Financial_Entity_AC_Detail__c" onsuccess={handleSuccess}>
    <lightning-messages> </lightning-messages>
    <lightning-input-field field-name="Name"> </lightning-input-field>
    <lightning-input-field field-name="Financial_Entity__c" value={currentPayeId} filter={filter}  disabled={isPayeeLookupDisabled}> </lightning-input-field>

    <lightning-input-field field-name="Bank_Account_Number__c"> </lightning-input-field>
    <lightning-input-field field-name="Bank_Name__c"> </lightning-input-field>
    <lightning-input-field field-name="Branch_Name__c"> </lightning-input-field>
    <lightning-input-field field-name="IFSC_Code__c"> </lightning-input-field>
    <lightning-input-field field-name="Task_ID__c" disabled value={taskId}> </lightning-input-field>
    <lightning-input-field field-name="Verification_Type__c"> </lightning-input-field>
    <lightning-button variant="destructive-text" label="Back" title="Back to payee" onclick={backToPayee} class="slds-m-right_meduim" disabled={isbackToPayeeDisabled}></lightning-button>

    <lightning-button class="slds-m-top_small" type="submit" label="Create new" variant="brand">
    </lightning-button>

</lightning-record-edit-form>

tried this standard salesforce lighting-record-edit-form to use on site but getting error the record is not createable

1

There are 1 best solutions below

2
eyescream On

Have you checked the permissions of the running user? What do you mean by "site", the old school Visualforce Sites, newer Digital Experiences (formerly known as customer portal, customer community)? Is this supposed to be used by a logged in user or unauthenticated.

Find your community user's Profile (or permission sets) and check if there's right to Create these objects (and Edit on the fields used in the form). If it's not a real logged in user - you can still hunt down the {Site Name} Guest User hidden Profile: https://help.salesforce.com/s/articleView?id=sf.rss_config_guest_user_profile.htm&type=5