2

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

3
  • 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, 2019 at 14:04
  • as @JayantDas says check Field level security for totalAmount__c & Active__c fields
    – sdandamud1
    May 24, 2019 at 14:11
  • Thank you guys! you were right! May 24, 2019 at 14:13

2 Answers 2

2

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

2
  • 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, 2019 at 14:18
  • Done, thanks for your help. May 24, 2019 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .