function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kalaivani KKalaivani K 

Can any one provide Lighting component example for Inline edit option ?

User-added image
Best Answer chosen by Kalaivani K
Khan AnasKhan Anas (Salesforce Developers) 
Hi Kalaivani,

Greetings to you!

You can use lightning:recordForm (https://developer.salesforce.com/docs/component-library/bundle/lightning:recordForm/documentation) component which enables you to quickly create forms to add, view, or update a record. Using this component to create record forms is easier than building forms manually with lightning:recordEditForm and lightning:recordViewForm.

Use mode="view" and pass the ID of the record and the corresponding object API name to be displayed. Specify the fields using the fields attribute, or layoutType attribute to display all the fields defined on the given layout.
The view mode loads the form using output fields with inline editing enabled. You can edit fields that are marked updateable in the User Interface API. If the user clicks an edit icon next to a field, all fields that are updateable become editable, and the form displays Submit and Cancel buttons.

This example creates a view mode form for an account record with fields from the full layout. Update the record ID with your own.
<lightning:recordForm
        recordId="001XXXXXXXXXXXXXXX"
        objectApiName="Account"
        layoutType="Full"
        mode="view" />

Please refer to the below links which might help you further with the above requirement.

https://www.sen-force.com/sample-student-app-revisited-with-lightningrecordform/

https://rajvakati.com/2018/05/29/lightningrecordform/

https://trailhead.salesforce.com/en/content/learn/projects/workshop-lightning-programmatic/use-lightning-recordform

If you want to edit your record from within the lightning table then you can use lightning:datatable, please refer to below links:

https://rajvakati.com/2018/11/13/lightningdatatable-inline-editing/

https://sfdcfacts.com/lightning/editable-lightningdatatable-summer18-feature/

http://www.infallibletechie.com/2018/11/inline-editing-in-lightningdatatable-in.html

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Kalaivani,

Greetings to you!

You can use lightning:recordForm (https://developer.salesforce.com/docs/component-library/bundle/lightning:recordForm/documentation) component which enables you to quickly create forms to add, view, or update a record. Using this component to create record forms is easier than building forms manually with lightning:recordEditForm and lightning:recordViewForm.

Use mode="view" and pass the ID of the record and the corresponding object API name to be displayed. Specify the fields using the fields attribute, or layoutType attribute to display all the fields defined on the given layout.
The view mode loads the form using output fields with inline editing enabled. You can edit fields that are marked updateable in the User Interface API. If the user clicks an edit icon next to a field, all fields that are updateable become editable, and the form displays Submit and Cancel buttons.

This example creates a view mode form for an account record with fields from the full layout. Update the record ID with your own.
<lightning:recordForm
        recordId="001XXXXXXXXXXXXXXX"
        objectApiName="Account"
        layoutType="Full"
        mode="view" />

Please refer to the below links which might help you further with the above requirement.

https://www.sen-force.com/sample-student-app-revisited-with-lightningrecordform/

https://rajvakati.com/2018/05/29/lightningrecordform/

https://trailhead.salesforce.com/en/content/learn/projects/workshop-lightning-programmatic/use-lightning-recordform

If you want to edit your record from within the lightning table then you can use lightning:datatable, please refer to below links:

https://rajvakati.com/2018/11/13/lightningdatatable-inline-editing/

https://sfdcfacts.com/lightning/editable-lightningdatatable-summer18-feature/

http://www.infallibletechie.com/2018/11/inline-editing-in-lightningdatatable-in.html

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
Kalaivani KKalaivani K
Thank you so much for your Reply!!!!. Now i am able to create Inline Edit component.
Kalaivani KKalaivani K
Is it possible to display text box based on the value selected from dropdown using this
<lightning:recordForm recordId="001XXXXXXXXXXXXXXX" objectApiName="Account" layoutType="Full" mode="view" />