Use Lightning Data Service to Edit/Update Record on Account Object Uses of ‘lightning:recordForm’ in Lightning Component Salesforce | lightning data service to edit and update the record

1,809 views


Hey guys, today in this post we are going to learn about How to Edit and Update Record of Account Object through Lightning Data Service Uses of ‘lightning:recordForm’ in Lightning Component Salesforce.

Files we used in this post example

lightningDataServiceCmp.cmp Lightning Component It is used to Edit/Update records of Account Object using lightning data service ‘lightning:recordForm’ in aura lightning component.

Final Output

lightning data service in aura lightning component -- w3web.net

 

You can download file directly from github by Click Here.

Note:: – You will get an email, so put correct email and mobile number and BEGIN YOUR JOURNEY from Today!

 

 

 

Other related post that would you like to learn in Salesforce

 

Create Lightning Component

Step 1:- Create Lightning Component : lightningDataServiceCmp.cmp

From Developer Console >> File >> New >> Lightning Component

lightningDataServiceCmp.cmp [Lightning Component File]

  1.  <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
  2.     <aura:attribute name="fields" type="String[]" default="['Name','AnnualRevenue','Industry','Refer_Code__c','Website','Phone','Rating','AnnualRevenue','AccountNumber','Active__c','Refer_Code__c','ShippingAddress']" />
  3.     <aura:attribute name="recordId" type="String"/>
  4.  
  5.         <lightning:recordForm
  6.                           aura:id="myRecordForm"          
  7.                           objectApiName="Account"
  8.                           recordId="{!v.recordId}"          
  9.                           fields="{!v.fields}"
  10.                           columns="2"
  11.                           mode="view"                     
  12.                           />
  13.  
  14. <br/><br/>
  15.    <!--Start RelatedTopics Section-->
  16. <div style="border:1px #ddd solid; padding:10px; background:#eee; margin:40px 0;">
  17.  
  18.             <p data-aura-rendered-by="435:0"><img src="https://www.w3web.net/wp-content/uploads/2021/05/thumbsUpLike.png" width="25" height="25" style="vertical-align:top; margin-right:10px;" data-aura-rendered-by="436:0"><strong data-aura-rendered-by="437:0"><span style="font-size:16px; font-style:italic; display:inline-block; margin-right:5px;">Don't forget to check out:-</span><a href="https://www.w3web.net/" target="_blank" rel="noopener noreferrer" style="text-decoration:none;" data-aura-rendered-by="440:0">An easy way to learn step-by-step online free Salesforce tutorial, To know more Click  <span style="color:#ff8000; font-size:18px;" data-aura-rendered-by="442:0">Here..</span></a></strong></p>
  19.  
  20.             <br/><br/>
  21.             <p data-aura-rendered-by="435:0"><img src="https://www.w3web.net/wp-content/uploads/2021/07/tickMarkIcon.png" width="25" height="25" style="vertical-align:top; margin-right:10px;" data-aura-rendered-by="436:0"><strong data-aura-rendered-by="437:0"><span style="font-size:17px; font-style:italic; display:inline-block; margin-right:5px; color:rgb(255 128 0);">You May Also Like →</span> </strong></p>
  22.             <div style="display:block; overflow:hidden;"> 
  23.                 <div style="width: 50%; float:left; display:inline-block">
  24.                     <ul style="list-style-type: square; font-size: 16px; margin: 0 0 0 54px; padding: 0;"> 
  25.                         <li><a href="https://www.w3web.net/lwc-get-set-lightning-checkbox-value/" target="_blank" rel="noopener noreferrer">How to get selected checkbox value in lwc</a></li>
  26.                         <li><a href="https://www.w3web.net/display-account-related-contacts-in-lwc/" target="_blank" rel="noopener noreferrer">how to display account related contacts based on AccountId in lwc</a></li>
  27.                         <li><a href="https://www.w3web.net/create-lightning-datatable-row-actions-in-lwc/" target="_blank" rel="noopener noreferrer">how to create lightning datatable row actions in lwc</a></li>
  28.                         <li><a href="https://www.w3web.net/if-and-else-condition-in-lwc/" target="_blank" rel="noopener noreferrer">how to use if and else condition in lwc</a></li>
  29.                         <li><a href="https://www.w3web.net/get-selected-radio-button-value-and-checked-default-in-lwc/" target="_blank" rel="noopener noreferrer">how to display selected radio button value in lwc</a></li>
  30.                     </ul>
  31.             </div>
  32.  
  33.             <div style="width: 50%; float:left; display:inline-block">
  34.                     <ul style="list-style-type: square; font-size: 16px; margin: 0 0 0 54px; padding: 0;"> 
  35.                         <li><a href="https://www.w3web.net/display-account-related-contacts-lwc/" target="_blank" rel="noopener noreferrer">display account related contacts based on account name in lwc</a></li>
  36.                         <li><a href="https://www.w3web.net/create-lightning-datatable-row-actions-in-lwc/" target="_blank" rel="noopener noreferrer">how to insert a record of account Using apex class in LWC</a></li>
  37.                         <li><a href="https://www.w3web.net/fetch-picklist-values-dynamic-in-lwc/" target="_blank" rel="noopener noreferrer">how to get picklist values dynamically in lwc</a></li>
  38.                         <li><a href="https://www.w3web.net/edit-save-and-remove-rows-dynamically-in-lightning-component/" target="_blank" rel="noopener noreferrer">how to edit/save row dynamically in lightning component</a></li>
  39.                         <li><a href="https://www.w3web.net/update-parent-object-from-child/" target="_blank" rel="noopener noreferrer">update parent field from child using apex trigger</a></li>
  40.                     </ul>
  41.                 </div>
  42.                <div style="clear:both;"></div> 
  43.                <br/>
  44.                 <div class="youtubeIcon">
  45.                     <a href="https://www.youtube.com/channel/UCW62gTen2zniILj9xE6LmOg" target="_blank" rel="noopener noreferrer"><img src="https://www.w3web.net/wp-content/uploads/2021/11/youtubeIcon.png" width="25" height="25" style="vertical-align:top; margin-right:10px;"/> <strong>TechW3web:-</strong> To know more, Use this <span style="color: #ff8000; font-weight: bold;">Link</span> </a>
  46.                 </div>
  47.     </div>
  48.  
  49. </div>
  50.  
  51.   <!--End RelatedTopics Section-->
  52.  
  53. </aura:component>

lightning data service in aura lightning component -- w3web.net

 

Further post that would you like to learn in Salesforce

Note:: – You will get an email, so put correct email and mobile number and BEGIN YOUR JOURNEY from Today!
 
 

 

 

 

FAQ (Frequently Asked Questions)

What is lightning data service in Salesforce?

Lightning Data Service is a centralized data caching framework which is used to load, save, create and delete a record without server-side apex code. It supports the sharing rules and field-level security as well.

What is lightning data service trailhead?

Lightning Data Service uses an object named force:recordData to perform CRUD interactions on records. When a value is assigned to the recordId attribute, behind the scenes, Lightning Data Service retrieves either the entire record or the requested fields.

What is the use of lightning data service?

Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code. Lightning Data Service handles sharing rules and field-level security for you.

Related Topics | You May Also Like

 
Note:: – You will get an email, so put correct email and mobile number and BEGIN YOUR JOURNEY from Today!
 
 
  

Our Free Courses →

👉 Get Free Course →

📌 Salesforce Administrators

📌 Salesforce Lightning Flow Builder

📌 Salesforce Record Trigger Flow Builder

👉 Get Free Course →

📌 Aura Lightning Framework

📌 Lightning Web Component (LWC)

📌 Rest APIs Integration



Hi, This is Vijay Kumar behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time. [Read full bio] | | The Sitemap where you can find all published post on w3web.net

Leave a Comment