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
test vijaytest vijay 

How to show records at View and Edit mode from LDS In Aura

hello folks,
I have a requirment in which I want to show some fields of  object based on recordId.I am using Lightning:editForm but problam is that everytime all fields keep on edit mode. I can use Lightning:RecordForm but I have to show fields in section.

My Main Requirment is that when page will load at that time all fields will show on view mode and when user click on Edit  Icon at that time record turn in edit mode such as standard Record form but I have to show fields in section.
Can someone help me to achieve this requirment.
I will be grateful.
Thanks In Advance
Best Answer chosen by test vijay
ravi soniravi soni
hy vijay,
You have to use lightning:recordEditForm and lightning:inputFields and outputFields. you can use lightning:accordionSection in which you can show some fields.
#1. Create a lightning:recordEditForm and show some outputFields in section and next to fields you have to add lightning:ButtonIcon IconName="Edit" and when user click on edit button at that time you can hide output fileds and show inputFields section.
#2. Create a Cancel button when user click cancel button you can be shown outputFields section.
#3. for hide/show, use only aura:if section.

apply above steps and let us know what was keep you status.
Don't forget to mark it as best answer.
Thank you