0

I am using a lightning-record-edit-form as shown below

<lightning-record-edit-form object-api-name="Client_Intake__c">
    <lightning-input-field  name="Id" field-name="Hub_Spoke_Account__c" style="width: 650px;" onchange={handleAccountFieldChange}></lightning-input-field>
</lightning-record-edit-form>

According to https://www.lightningdesignsystem.com/components/form-element/ , the lightning-input-field control value is supposed to be required only if we add the required attribute to it. Even though I do not have the required attribute set on the lightning-input-field , it is still being displayed as a required field. How can I fix this? enter image description here

Burak
  • 300
  • 2
  • 14

1 Answers1

0

A bit late to the party here, but:

Even though you haven't specified the field as required on the lightning-input-field, the field is still required in Setup, hence why it is showing as required here. This is a feature (or limitation if you will) of the lightning-record-edit form. The only solution really is to set the field as not required in Setup -> Object Manager, and to only make it required on the relevant page layouts where applicable.

Also, you will get answers a lot faster on salesforce.stackexchange.com

Lian Bond
  • 76
  • 1
  • 4