Lightning:RecordEditForm Save Data Without Apex

In the last post we check the Lightning:recordForm Which is a great tool. But there some limitation.  Like we can’t prepopulate data in that. So today we will check another component, Lightning:RecordEdit form.

It is very good component, using this we can create edit page, check our custom validation and store the data into Salesforce without using single line of apex code.

Lightning Record Edit Form

Lightning:input field check the basic validation of data format and required field so we don’t need to worry about them. In case we get any system validation error it will show them using lightning:messages tag. It will also support dependent picklist out of the box so that also a nice feature.

After record save successfully we are using lightning:navigation component to redirect to detail page. It is a new component launched recently. We use this to navigate to a given pageReference or to generate a URL from a pageReference.

So now we have many component out of the box which we can use to create basic Edit/Detail screens in Lightning.

Did you want to add anything here, let me know in comments section. Happy programming 🙂

Advertisements

4 thoughts on “Lightning:RecordEditForm Save Data Without Apex

  1. Hi Tushar,

    I am trying to create a new record(Quote) from opportunity page by using quick action.
    I am using lightning:recordEditform but I am unable to save the record.
    Can you please help.

  2. Hi
    I am getting the following error, even though the record is saved and it is not going to the detail page.
    This page has an error. You might just need to refresh it.
    [Cannot read property ‘setParams’ of undefined]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.