You need to sign in to do that
Don't have an account?
NAVIN SELVARAJ 5
lightning:recordForm
Hi All,
I would like to display the contact details using <lightning:recordForm/>. But When I am trying to that, It is not working. Could Please help me out regarding this.
Here with I wull put my code. If anyof you having working code with <lightning:recordForm/> Please let me know as well.
I would like to display the contact details using <lightning:recordForm/>. But When I am trying to that, It is not working. Could Please help me out regarding this.
Here with I wull put my code. If anyof you having working code with <lightning:recordForm/> Please let me know as well.
<lightning:recordForm
recordId="0036F00002XkajhQAB"
objectApiName="Contact"
fields="Id"
columns="2"
layoutType ="Full"
mode="View"
onsuccess="{!c.myAction}"/>
recordId="0036F00002XkajhQAB"
objectApiName="Contact"
fields="Id"
columns="2"
layoutType ="Full"
mode="View"
onsuccess="{!c.myAction}"/>
<h1><b>Lightning Record Form<br/> Object_Name: {!v.sObjectName} - Record_Id: {!v.recordId} </b> </h1> </center> </div> <div class="THIS"> <lightning:recordForm recordId="{!v.recordId}" objectApiName="{!v.sObjectName}" fields="{!v.fieldsList}" columns="2" mode="View" onsuccess="{!c.myAction}"/> </div> </aura:component>
Refer below blog which has sample code for editing and displaying records with lightning:recordForm
http://sfdcfacts.com/lightning/lightningrecordform-powerful-component-for-viewing-and-editing-record-in-lightning/
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya
Mark as best answer, If it resloves !!
Don't hardcode fields in component .
Create a attribute for those fields and call in component and onSucess call your action on controller Mark as resloved if it helps :) :)
Thanks,
Bhanu Prakash
visit ForceLearn.com (https://www.forcelearn.com)
I will Show few Details of the contact in table. If i click any contact, I will open the panel in the right side and show the complete details of the contact using lightning:recordForm.
Herewith I will attach my complete code. Please refer and let me know where i went wrong.
Thanks in Advance.
DataTablePanel.cmp
DatTabelPanelController
AccountsController
Thanks in Advance,
Best Regards,
Navin S