1

I'm trying to create a new form for a custom Object in salesforce. This is my form Code:

<lightning:recordEditForm aura:id="MyFormId"
                                  objectApiName="MyCustomObject__c"     
                                  onload="{!c.handleOnload}"
                                  onsubmit="{!c.handleOnSubmit}"
                                  onsuccess="{!c.handleOnSuccess}"
                                  onerror="{!c.handleOnError}"
                                  class="slds-card__body_inner">

            <lightning:card iconName="utility:edit"  title="Edit" >                
                <div class = "slds-p-horizontal_large" >

                    <lightning:messages/>
                    <lightning:inputField fieldName="MarketAccount__c"/>
                    <lightning:inputField fieldName="TotalAmount__c"/>
                    <lightning:inputField fieldName="Active__c"/>
                    <lightning:inputField fieldName="LoanFunnel__c"/>
                    <lightning:inputField fieldName="Event__c"/>

                    <div class="slds-grid slds-grid_align-end slds-p-vertical_medium"> 
                        <lightning:button variant="brand"   label="Cancel" />
                        <lightning:button variant="brand"   label="Submit" type="submit" />
                    </div>
                </div> 
            </lightning:card>

        </lightning:recordEditForm>

Here is the Issue: The form is missing some fields and im not sure the reason:

enter image description here

I'm expecting 5 fields but there are being showing only 3.

MarketAccount__c type: lookup

TotalAmount__c type: number

Active__c type: checkbox

LoanFunnel__c type: lookup

Event__c type: lookup

  • 1
    Does the User accessing the component has access to the missing fields? lightning:recordEditForm honors FLS, so you may like to verify that. – Jayant Das May 24 at 14:04
  • as @JayantDas says check Field level security for totalAmount__c & Active__c fields – sdandamud1 May 24 at 14:11
  • Thank you guys! you were right! – Martin Larizzate May 24 at 14:13
1

Solved! It was a field accessibility issue.

The fields: MarketAccount__c and Active__c missed the user accessibility configs when them were moved with a changeset to my sandbox.

It was solved adding user rights following this steps

  • You should add more details to the answer viz., explaining which fields were missing FLS and how you made it to work to make this answer a more comprehensive and complete. – Jayant Das May 24 at 14:18
  • Done, thanks for your help. – Martin Larizzate May 24 at 14:24
1

Another reason that cause issues with lightning:inputField is if you don't fill the recordTypeId property of the lightning:recordEditForm, in case that exist more than one.

Docu of "lightning:recordEditForm":

https://developer.salesforce.com/docs/component-library/bundle/lightning:recordEditForm/specification

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.