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
...
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 :...
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);
}
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.
...
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 ...
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 ...
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, ...
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="{!!...
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">
<...
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 ...
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 ...
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 ...
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....
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:...
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 ...
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 ...
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 ...
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=...
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="...
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....
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.
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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:
...
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 ...
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.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
lightning-recordeditform × 244lightning-web-components × 108
lightning-aura-components × 81
lightning × 57
lightning-inputfield × 42
aura × 15
javascript × 13
apex × 7
inputfield × 7
lightning-record-form × 7
lightning-experience × 6
lightning-events × 6
lookup × 5
lightning-design-system × 5
modal × 5
validation × 4
error-messages × 4
lightning-data-service × 4
aura-id × 4
community × 3
picklist × 3
event × 3
dependent-picklist × 3
bug × 3
create-records × 3