Skip to main content
27 votes
Accepted

lightning:recordEditForm - Set or modify field values onsubmit

This is not the correct api for setting form values via javascript. It happened to work before, but that was not the supported api. The correct way to do this is this: <lightning:recordEditForm ...
Stephen Woods's user avatar
21 votes
Accepted

How to submit a lightning:recordEditForm from a button that isn't nested?

You can manually trigger the submit action of lightning:recordEditForm component without having to use <lightning:button type="button"/> which can be found in the new component documentation UI :...
Praveen's user avatar
  • 10.1k
17 votes
Accepted

How to get Created Record ID in Lightning:recordEditForm?

The below code will give us the created record id. handleSuccess : function(component, event, helper) { var payload = event.getParams().response; console.log(payload.id); }
Ravi Narayanan's user avatar
16 votes
Accepted

Setting attribute required to lightning:inputField

maybe I found a solution to the problem. This is what I have set up: In the object manager do not set the field in question to required. Rather, create a validation rule that checks for blank values. ...
Chris K.'s user avatar
  • 349
13 votes
Accepted

Easiest way to get a value from a lightning:inputField

Assuming your lightning:inputField tag has the aura:id of firstNameField, for example, you'd get its value with: var firstName = component.find("firstNameField").get("v.value"); In your second ...
Renato Oliveira's user avatar
12 votes
Accepted

How to programmatically submit a lightning-record-edit-form?

I have run into this often since moving from Aura to lightning web components (LWC) and have found that the only solution is to hide a submit button on the form, and then call click on it from your JS ...
Ronnie's user avatar
  • 2,117
9 votes
Accepted

On lightning:recordEditForm how can I retrieve the recordUi onload-actions return parameter?

It's an event handler, so you just use it like an attribute that accepts a controller method: <lightning:recordEditForm onload="{!c.recordLoaded}" ... function recordLoaded(component, event, ...
sfdcfox's user avatar
  • 500k
8 votes
Accepted

Is it possible to use lightning:recordEditForm dynamically on different object types with variable objectApiName?

So I faced a similar issue, I managed to solve it using aura:if aura:if doesnt create the inner components unless the condition is true. You can use it to your advantage. <aura:if isTrue="{!!...
Pranay Jaiswal's user avatar
8 votes
Accepted

Lightning InputField component with Salutation field

I got the same issue while working on recordEditForm. I usd the below hack/workaround to fix it. It worked for me. <lightning:recordEditForm objectApiName="Contact"> <...
Bhawna's user avatar
  • 400
8 votes
Accepted

Is it possible to mass-save many lightning:recordEditForms with only ONE button?

You can submit a lightning:recordEditForm programmatically. You can do so by retrieving the component via it's aura:id and calling the submit method. e.g. component.find('editForm').submit() Here ...
Antonio Manente's user avatar
7 votes

Lightning:inputField not allowing decimal numbers to be inserted

The issue seems in the way lightning:inputField has been implemented. Here are some interesting findings around lightning:inputField implementation. And I posted an idea based on this issue on the ...
Jayant Das's user avatar
  • 30.6k
7 votes
Accepted

How to do field validation on lightning:recordEditForm with lightning:inputField

You are not able to use validity on lightning:inputField because the attribute is not supported on this component, instead its an attribute for lighting:input. For validating lightning:inputField ...
Jayant Das's user avatar
  • 30.6k
7 votes
Accepted

recordEditForm not loading related record via lookup

So I figured this out. recordEditForm upholds not only FLS, but also "Field Accessibility". So in this case the standard Page Layout for the record I was editing did not have the Account field on it....
Jason Benkert's user avatar
6 votes
Accepted

lighting:recordEditForm error Cannot read property 'defaultRecordTypeId' of undefined

I thought it would be helpful for someone who runs into this issue, would find solace here. I needed to use exact ObjectApiName of the object, i.e. SBQQ__Quote__c and that worked fine. <aura:...
Mahmood's user avatar
  • 5,976
6 votes
Accepted

How to find a dynamically assigned aura:id?

aura:id can't be populated dynamically: aura:id doesn't support expressions. You can only assign literal string values to aura:id. Instead, give all of your <lightning:inputField> components ...
David Reed's user avatar
  • 93.4k
6 votes

Building an efficient LWC form without record-edit-form

There is no need of Apex as you have standard updateRecord. Get the record values from onload event of record-edit-form and create a record structure from that data. Filter the fields based on what ...
salesforce-sas's user avatar
6 votes
Accepted

Building an efficient LWC form without record-edit-form

Since lightning-input-field now has a required attribute, I decided to use lightning-record-edit-form. I'm using both lightning-input-field and lightning-input because some of the form fields reside ...
David Cheng's user avatar
  • 7,390
5 votes
Accepted

How to validate the values before saving a record through lightning:recordEditForm and lightning:inputField?

There is a way to bind the lighthning:inputField value to an Instance of an Object. Here is an Example code, Parent Component: <aura:component > <aura:attribute name="testContact" type=...
am_Aravi's user avatar
  • 392
5 votes

How to use $A.createComponents() on lightning:recordEditForm with nested lightning:inputField?

I came up with a way to do this; you have to create the children first, and then the parent, similar to how the system would do it in mockup. Here's a demonstration: <aura:application extends="...
sfdcfox's user avatar
  • 500k
5 votes
Accepted

Show form with page layouts && intercept save ... Lightning:recordForm / force:recordData

Your option 2, using lightning:recordForm, is the solution. You just need to update your submit handler code. In your cmp: <lightning:recordForm aura:id="form" recordId = "{! v....
Kevin Venkiteswaran's user avatar
5 votes
Accepted

RecordEditForm: Reset inputfield after successful submit

I guess you can add your lightning:recordEditForm inside the aura:if and reset the flag variable used in aura:if in insaveComplete() method .This will refresh the form.
Rohan Deoskar's user avatar
5 votes

How to get record Id from Lightning record edit form on record insert

the component documentation has a sample snippet for you to do so. using the onsuccess event, you have access to the response object which contains, amongst other things, the id of the record that ...
glls's user avatar
  • 20.3k
5 votes
Accepted

lightning-record-edit-form: Not Refreshing - Caching Issue

The problem is not because of cache. Initially (before changing values) when you change record-id the values in all input-fields will also reflect correct record values but when you change any of the ...
salesforce-sas's user avatar
5 votes

Error: Unknown public property "name" of element <LIGHTNING-INPUT-FIELD>. This is likely a typo on the corresponding attribute "name"

I had the same issue and identified the reason to be 'Debug Mode' enabled for the user. Once I disabled the Debug mode, the issue was resolved. It doesn't make much sense and looks like a Salesforce ...
Vignesh Venkatesan's user avatar
4 votes

lightning:recordEditForm "Received unexpected value during emit" error on loading randomly

I have also been suffering form this issue. I use a lightning.recordEditForm component with some visible and some hidden lightning:inputField elements inside it, to create a clone Quote record inside ...
TSunar's user avatar
  • 197
4 votes

Set custom placeholder in lightning:recordEditForm

It seems you cannot provide a custom placeholder text in lookup fields while using lightning:inputField. Even though the component is rendered as an input type=text with a placeholder attribute you ...
Jayant Das's user avatar
  • 30.6k
4 votes
Accepted

Position submit button of the lightning:recordEditForm in the footer part of the modal window in slds

Let's put my answer here, so that it is visible for everyone interested. Submit button doesn't have to be inside lightning:recordEditForm. You can put it outside and define JS function onlick. There ...
rmatusiak's user avatar
  • 332
4 votes

LWC - Handling Save Event on Record Edit Page

Hi, i had this same problem but i ended up creating a custom lwc for the update. Like this: ...
dibocor's user avatar
  • 1,327
4 votes
Accepted

LWC Lightning Record Edit Form Case Assignment Rules

There's no direct way of running the assignment rule if you are using lightning-record-edit-form. With little customization, you can though achieve this. You can introduce a custom checkbox in your ...
Jayant Das's user avatar
  • 30.6k
4 votes

LWC - Bypass Field-Level Security using Lightning-Input-Field?

No, it's not possible. Instead, you'd have to use getObjectInfo and render your own UI.
sfdcfox's user avatar
  • 500k

Only top scored, non community-wiki answers of a minimum length are eligible