<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sfdc &#8211; Hamza Siddiqui</title>
	<atom:link href="https://www.mhamzas.com/blog/tag/sfdc/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mhamzas.com</link>
	<description>4x Salesforce MVP &#124; 26x Certified &#124; Salesforce App &#38; System Architect</description>
	<lastBuildDate>Mon, 06 Apr 2020 16:54:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">233526040</site>	<item>
		<title>Insert Records in multiple Objects in single DML</title>
		<link>https://www.mhamzas.com/blog/2020/04/06/insert-records-in-multiple-objects-in-single-dml/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=insert-records-in-multiple-objects-in-single-dml</link>
					<comments>https://www.mhamzas.com/blog/2020/04/06/insert-records-in-multiple-objects-in-single-dml/#respond</comments>
		
		<dc:creator><![CDATA[hamza]]></dc:creator>
		<pubDate>Mon, 06 Apr 2020 16:54:37 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[apex]]></category>
		<category><![CDATA[sfdc]]></category>
		<guid isPermaLink="false">https://www.mhamzas.com/?p=3082</guid>

					<description><![CDATA[There could be many cases where you need to insert records in multiple objects in a single method but you might end up with TOO MANY DMLs Error. Here we&#8217;ll discuss how you can insert records in multiple objects in a single <br /><a href="https://www.mhamzas.com/blog/2020/04/06/insert-records-in-multiple-objects-in-single-dml/" class="more-link btn btn-primary">Read More</a>]]></description>
										<content:encoded><![CDATA[
<p>There could be many cases where you need to insert records in multiple objects in a single method but you might end up with TOO MANY DMLs Error.</p>



<p>Here we&#8217;ll discuss how you can insert records in multiple objects in a single dml call.</p>



<p>Let&#8217;s assume you need to add records in Account, Contact and AccountContact (Custom Object). By using the below code, you add records in all 3 objects in a single DML call.</p>



<script src="https://gist.github.com/mhamzas/64bbccc25a41f68509e83781ee8baa0e.js"></script>



<p>Source : <a href="https://salesforce.stackexchange.com/questions/141897/insert-multiple-sobjects-in-single-dml-call">https://salesforce.stackexchange.com/questions/141897/insert-multiple-sobjects-in-single-dml-call</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mhamzas.com/blog/2020/04/06/insert-records-in-multiple-objects-in-single-dml/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3082</post-id>	</item>
		<item>
		<title>Get Hands-on Creating Custom Tabs for Lightning Web Components &#8211; Challenge</title>
		<link>https://www.mhamzas.com/blog/2019/12/13/get-hands-on-creating-custom-tabs-for-lightning-web-components-challenge/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-hands-on-creating-custom-tabs-for-lightning-web-components-challenge</link>
					<comments>https://www.mhamzas.com/blog/2019/12/13/get-hands-on-creating-custom-tabs-for-lightning-web-components-challenge/#comments</comments>
		
		<dc:creator><![CDATA[hamza]]></dc:creator>
		<pubDate>Fri, 13 Dec 2019 10:48:02 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[maintenancetrail]]></category>
		<category><![CDATA[sfdc]]></category>
		<category><![CDATA[winter20]]></category>
		<guid isPermaLink="false">https://www.mhamzas.com/?p=3042</guid>

					<description><![CDATA[For Winter 20&#8242; release maintenance trail, you have to do a Hands-on Challenge to add Lightning Web Component as Salesforce Tab. Requirement : Create a Lightning web component and add it as a custom tab in the App Launcher and navigation menu. <br /><a href="https://www.mhamzas.com/blog/2019/12/13/get-hands-on-creating-custom-tabs-for-lightning-web-components-challenge/" class="more-link btn btn-primary">Read More</a>]]></description>
										<content:encoded><![CDATA[
<p>For Winter 20&#8242; release maintenance trail, you have to do a Hands-on Challenge to add Lightning Web Component as Salesforce Tab.</p>



<p><strong>Requirement </strong>: <em>Create a Lightning web component and add it as a custom tab in the App Launcher and navigation menu.</em></p>



<p>Following are the instructions : </p>



<ul class="wp-block-list"><li>Install this package on your org : https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1v0000021k2c (if you do not have pass for your trailhead org, simply replace &#8221; login.salesforce.com &#8221; with your org domain)</li><li>Setup > Tabs</li><li>Create new Lightning Component tab and add &#8220;<strong>c:myComponent</strong>&#8221; with Tab name &#8220;<strong>Words</strong>&#8220;.</li><li>You&#8217;re done ! that&#8217;s it.</li></ul>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="640" height="293" src="https://i0.wp.com/www.mhamzas.com/wp-content/uploads/2019/12/image.png?resize=640%2C293&#038;ssl=1" alt="" class="wp-image-3043" srcset="https://i0.wp.com/www.mhamzas.com/wp-content/uploads/2019/12/image.png?w=701&amp;ssl=1 701w, https://i0.wp.com/www.mhamzas.com/wp-content/uploads/2019/12/image.png?resize=300%2C137&amp;ssl=1 300w" sizes="(max-width: 640px) 100vw, 640px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mhamzas.com/blog/2019/12/13/get-hands-on-creating-custom-tabs-for-lightning-web-components-challenge/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3042</post-id>	</item>
		<item>
		<title>Upserts with Generic sObjects &#8211; Salesforce</title>
		<link>https://www.mhamzas.com/blog/2019/12/13/upserts-with-generic-sobjects-salesforce/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=upserts-with-generic-sobjects-salesforce</link>
					<comments>https://www.mhamzas.com/blog/2019/12/13/upserts-with-generic-sobjects-salesforce/#respond</comments>
		
		<dc:creator><![CDATA[hamza]]></dc:creator>
		<pubDate>Fri, 13 Dec 2019 07:24:47 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[apex]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[sfdc]]></category>
		<category><![CDATA[sObject]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://www.mhamzas.com/?p=3038</guid>

					<description><![CDATA[Have you ever run into this error? “Upsert with a field specification requires a concrete SObject type” Basically it is saying that you cannot declare a list of type sObject and then try to use the upsert command against that list. That <br /><a href="https://www.mhamzas.com/blog/2019/12/13/upserts-with-generic-sobjects-salesforce/" class="more-link btn btn-primary">Read More</a>]]></description>
										<content:encoded><![CDATA[
<p>Have you ever run into this error? “Upsert with a field specification requires a concrete SObject type”</p>



<p>Basically it is saying that you cannot declare a list of type sObject and then try to use the upsert command against that list. That limitation can make coding generic routines difficult which do not know the specific object type up front. For example, I might be building a table driven integration layer where the user will determine, by updating a custom field or custom setting, what the name of the destination custom object will be. With this approach I will need to use the generic sObject data type, but that will stop me from using the upsert database command.</p>



<p>Bummer! What to do?</p>



<p>Here is a&nbsp;<a href="http://salesforce.stackexchange.com/questions/61340/is-it-possible-to-upsert-a-listsobject-with-external-id-specified">link</a>&nbsp;that describes this problem very clearly and jangiz at the bottom describes the correct work-around approach.</p>



<p>Here is some code to implement that work-around that jangiz described:</p>



<script src="https://gist.github.com/mhamzas/eee6a82d5543ed6e853858d4156b1300.js"></script>



<p>Wow, what a bunch of work when I really just wanted to write…<br>upsert sObjList myExternalIDField</p>



<p>But as long as there is a manageable work-around I can at least move forward!</p>



<p>Good luck with your Apex today!</p>



<p>Source :  <a href="https://www.sundoginteractive.com/blog/generic-sobjects-salesforce">https://www.sundoginteractive.com/blog/generic-sobjects-salesforce</a> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mhamzas.com/blog/2019/12/13/upserts-with-generic-sobjects-salesforce/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3038</post-id>	</item>
		<item>
		<title>Usage Of lightning-record-form</title>
		<link>https://www.mhamzas.com/blog/2019/11/18/usage-of-lightning-record-form/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=usage-of-lightning-record-form</link>
					<comments>https://www.mhamzas.com/blog/2019/11/18/usage-of-lightning-record-form/#respond</comments>
		
		<dc:creator><![CDATA[hamza]]></dc:creator>
		<pubDate>Mon, 18 Nov 2019 11:58:36 +0000</pubDate>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[lwc]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[sfdc]]></category>
		<guid isPermaLink="false">https://www.mhamzas.com/?p=3015</guid>

					<description><![CDATA[Let us discuss&#160;here how&#160;to use the lightning-record-form . A&#160;lightning-record-form&#160;component 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&#160;lightning-record-edit-form&#160;and&#160;lightning-record-view-form. However,&#160;lightning-record-form&#160;does not support client-side validation quite <br /><a href="https://www.mhamzas.com/blog/2019/11/18/usage-of-lightning-record-form/" class="more-link btn btn-primary">Read More</a>]]></description>
										<content:encoded><![CDATA[
<p>Let us discuss&nbsp;here how&nbsp;to use the lightning-record-form . A&nbsp;<code>lightning-record-form</code>&nbsp;component 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&nbsp;<code>lightning-record-edit-form</code>&nbsp;and&nbsp;<code>lightning-record-view-form</code>. However,&nbsp;<code>lightning-record-form</code>&nbsp;does not support client-side validation quite the same as&nbsp;<code>lightning-record-edit-form</code>.The&nbsp;<code>object-api-name</code>&nbsp;attribute is always required, and the&nbsp;<code>record-id</code>&nbsp;is required unless you’re creating a record.</p>



<h2 class="wp-block-heading">Modes</h2>



<p>The component accepts a&nbsp;<code>mode</code>&nbsp;value that determines the user interaction allowed for the form. The value for&nbsp;<code>mode</code>&nbsp;can be one of the following:</p>



<ul class="wp-block-list"><li><code>edit</code>&nbsp;– Creates an editable form to add a record or update an existing one. When updating an existing record, specify the recordId. Edit mode is the default, and as such, can be omitted.</li><li><code>view</code>&nbsp;– Creates a form to display a record that the user can also edit. The record fields each have an edit button.</li><li><code>readonly</code>&nbsp;– Creates a form to display a record without enabling edits. The form doesn’t display any buttons.</li></ul>



<p>For all modes, the component expects the&nbsp;<code>fields</code>&nbsp;attribute, the&nbsp;<code>layout-type</code>&nbsp;attribute, or both. Use the&nbsp;<code>fields</code>&nbsp;attribute to specify a comma-separated list of record fields to load into the form. The fields load in the order you list them. Use the&nbsp;<code>layout-type</code>&nbsp;attribute to specify a&nbsp;<code>Full</code>&nbsp;or&nbsp;<code>Compact</code>&nbsp;layout. All fields that have been assigned to the layout are loaded into the form. This is the same behavior as the Lightning Data Service’s&nbsp;<code>force:recordData</code>&nbsp;object. Layouts are typically created or modified by administrators. Loading record data using&nbsp;<code>layout-type</code>&nbsp;allows the form to adapt to those layout definitions. If you provide the&nbsp;<code>fields</code>&nbsp;attribute and the&nbsp;<code>layout-type</code>&nbsp;attribute, the fields specified in the&nbsp;<code>fields</code>&nbsp;attribute are loaded before the layout fields.</p>



<p>This component takes care of field-level security and sharing for you, so users see only the data that they have access to.</p>



<h2 class="wp-block-heading">Creating a Record</h2>



<p>Use&nbsp;<code>mode="edit"</code>&nbsp;and pass in the object API name for the record to be created. Do not specify a recordId. Specify the fields using the&nbsp;<code>fields</code>&nbsp;attribute, or&nbsp;<code>layout-type="Full"</code>&nbsp;attribute to load all the fields defined on the full layout.The<em>&nbsp;compact layout cannot be used for creating records. If you&nbsp;</em>specify&nbsp;<em><code>layout-type="Compact"</code></em>,<em>&nbsp;the full layout is shown.</em>&nbsp;If you specify the&nbsp;<code>fields</code>&nbsp;attribute, be sure to include any fields that are designated as required for the object’s records. Because no recordId is passed, edit mode loads the form with input fields that aren’t populated with field data. The form displays Submit and Cancel buttons.This<em><strong>&nbsp;example creates an editable two-column form with the full layout and additional fields</strong></em>. The form is used for creating records in an Account object. The&nbsp;<code>onsubmit</code>&nbsp;attribute specifies an action to override the handler for the submit.</p>



<p>Create a Lightning web component&nbsp;using the below SFDX command</p>



<pre class="wp-block-code"><code>sfdx force:lightning:component:create --type lwc --componentname recordform --outputdir force-app\main\default\lwc</code></pre>



<p>Use the below recordform.html code</p>



<pre class="wp-block-code"><code>&lt;template>    
&lt;lightning-record-form object-api-name="Account" layout-type="Compact" columns="2" mode="edit"     onsuccess={handleSuccess} onsubmit={handleSubmit}>    
&lt;/lightning-record-form>&lt;/template></code></pre>



<p>Use the below recordform.js code</p>



<pre class="wp-block-code"><code>import {LightningElement,api} from 'lwc'; 
export default class Recordform extends LightningElement {     
  handleSubmit(event) {        
   console.log(event.detail)    
  }    
  handleSuccess(event) {        
   console.log('Record iD' + event.detail.id);     
  }
}</code></pre>



<p>Use the below recordform.js-meta.xml code</p>



<pre class="wp-block-code"><code>&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">    &lt;apiVersion>45.0&lt;/apiVersion>    
&lt;isExposed>true&lt;/isExposed>    
&lt;targets>        
  &lt;target>lightning__RecordPage&lt;/target>    
&lt;/targets>
&lt;/LightningComponentBundle></code></pre>



<p>Push the changes and add this component to the record page layout.&nbsp;you can able to see the complete record create a form</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://i0.wp.com/rajvakati.com/wp-content/uploads/2019/02/Capture-36.png?resize=678%2C361&amp;ssl=1" alt="" class="wp-image-10355"/></figure></div>



<p>Now let’s see how to use create a record with specific fields. Now update the recordform.html code as shown below</p>



<pre class="wp-block-code"><code>&lt;template>    
&lt;lightning-record-form object-api-name={accountObject}  fields={myFields} mode="edit" onsuccess={handleSuccess} onsubmit={handleSubmit}>    
&lt;/lightning-record-form>
&lt;/template></code></pre>



<p>Use the below recordform.js code which will be passed to the record form.</p>



<pre class="wp-block-code"><code>import {LightningElement,api} from 'lwc';
import ACCOUNT_OBJECT from '@salesforce/schema/Account';
import NAME_FIELD from '@salesforce/schema/Account.Name';
import WEBSITE_FIELD from '@salesforce/schema/Account.Website';

export default class Recordform extends LightningElement {      
 accountObject = ACCOUNT_OBJECT;     
 myFields = &#091;NAME_FIELD, WEBSITE_FIELD];         
 handleSubmit(event) {        
  console.log(event.detail);    
 }    
 handleSuccess(event) {        
  console.log('Record iD' + event.detail.id);     
 }
}</code></pre>



<p>Push the changes and you can able to see the create form with two fields as shown below.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://i1.wp.com/rajvakati.com/wp-content/uploads/2019/02/Capture-37.png?resize=678%2C135&amp;ssl=1" alt="" class="wp-image-10357"/></figure></div>



<h2 class="wp-block-heading">Editing a Record</h2>



<p>If you do not specify the <code>mode</code> attribute, its default value is <code>edit</code>. To edit a record, pass the ID of the record and the corresponding object API name to be edited. Specify the fields using the <code>fields</code> attribute, or <code>layout-type</code> attribute to load all the fields defined on the Full or Compact layout. When <code>record-id</code> is passed, edit mode loads the form with input fields displaying the specified record’s field values. The form also displays Submit and Cancel buttons. This example creates an editable two-column form with a compact layout and additional fields. The form is used for editing records in an Account object. The <code>onsubmit</code> attribute specifies an action to override the handler for the submit. Update the recordform.html code as shown below.</p>



<pre class="wp-block-code"><code>&lt;template>    
&lt;lightning-record-form record-id={recordId} object-api-name="Account" layout-type="Full" columns="2" mode="edit" onsuccess={handleSuccess} onsubmit={handleSubmit}>    
&lt;/lightning-record-form>
&lt;/template></code></pre>



<p>update the recordform.js code as shown below.</p>



<pre class="wp-block-code"><code>import {LightningElement, api} from 'lwc'; 
export default class Recordform extends LightningElement {    
 @api recordId;    
 handleSubmit(event) {      
  console.log(event.detail);  
 }    
 handleSuccess(event) {       
  console.log('Record iD' + event.detail.id);    
 }
}</code></pre>



<p>Use&nbsp;<code>mode="view"</code>&nbsp;and pass the ID of the record and the corresponding object API name to be displayed. Specify the fields using the&nbsp;<code>fields</code>&nbsp;attribute, or&nbsp;<code>layout-type</code>&nbsp;attribute to display all the fields defined on the Full or Compact layout.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://i0.wp.com/rajvakati.com/wp-content/uploads/2019/02/Capture-38.png?resize=678%2C280&amp;ssl=1" alt="" class="wp-image-10360"/></figure></div>



<p>the following code shows the how to edit the specific fields instead of layouts.update the recordform.html code as below.</p>



<pre class="wp-block-code"><code>&lt;template>    
&lt;lightning-record-form object-api-name={accountObject} record-id={recordId}  fields={myFields} mode="edit"        
onsuccess={handleSuccess} onsubmit={handleSubmit}>    
&lt;/lightning-record-form>&lt;/template></code></pre>



<p>update the recordform.js code as shown below.</p>



<pre class="wp-block-code"><code>import {    LightningElement,    api} from 'lwc';
import ACCOUNT_OBJECT from '@salesforce/schema/Account';
import NAME_FIELD from '@salesforce/schema/Account.Name';
import WEBSITE_FIELD from '@salesforce/schema/Account.Website';

export default class Recordform extends LightningElement {     
@api recordId ;      
accountObject = ACCOUNT_OBJECT;     
myFields = &#091;NAME_FIELD, WEBSITE_FIELD];  
       
handleSubmit(event) {       
 console.log(event.detail);   
}    
handleSuccess(event) {       
 console.log('Record iD' + event.detail.id);    
 }
}</code></pre>



<p>Now you can able to see the changes as shown below with the specified fields.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://i0.wp.com/rajvakati.com/wp-content/uploads/2019/02/Capture-40.png?resize=678%2C142&amp;ssl=1" alt="" class="wp-image-10362"/></figure></div>



<h2 class="wp-block-heading">Viewing a Record Read-Only</h2>



<p>The simplest way to display a record is to use the&nbsp;<code>lightning-record-form</code>. You can display a record in two modes.<code>view</code>Loads the form using output fields with inline editing enabled. Editable fields have edit icons. If a user clicks an edit icon, all fields in the form become editable, and the form displays Submit and Cancel buttons.<code>read-only</code>Read-only mode loads the form with output fields only. The form doesn’t include edit icons, Submit and Cancel buttons.</p>



<p>This code displays an account record in view mode using the compact layout, which includes fewer fields than the full layout.</p>



<p>Use <code>mode="readonly"</code> and pass the ID of the record and the corresponding object API name to be displayed. Specify the fields using the <code>fields</code> attribute, or <code>layout-type</code> attribute to display all the fields defined on the Full or Compact layout. The read-only mode loads the form with output fields only, and without Submit or Cancel buttons.The following code specifis how to use the read-only mode. Use the below recordform.html code.</p>



<pre class="wp-block-code"><code>&lt;template>    
&lt;lightning-record-form record-id={recordId} object-api-name="Account"     
layout-type="Full" columns="2" mode="readonly"         
onsuccess={handleSuccess} onsubmit={handleSubmit}>    
&lt;/lightning-record-form>
&lt;/template></code></pre>



<p>You can able to see the record with read-only data .</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://i2.wp.com/rajvakati.com/wp-content/uploads/2019/02/Capture-41.png?resize=678%2C283&amp;ssl=1" alt="" class="wp-image-10364"/></figure></div>



<p>Let’s update the code with view mode as shown below.&nbsp;<code>view&nbsp;</code>Loads the form using output fields with inline editing enabled. Editable fields have edit icons. If a user clicks an edit icon, all fields in the form become editable, and the form displays Submit and Cancel buttons.</p>



<p>Update the code as shown below and you can able to see the edit icon</p>



<pre class="wp-block-code"><code>&lt;template>    
&lt;lightning-record-form record-id={recordId} object-api-name="Account" layout-type="Full"     columns="2" mode="View" onsuccess={handleSuccess} onsubmit={handleSubmit}>    
&lt;/lightning-record-form>&lt;/template></code></pre>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://i0.wp.com/rajvakati.com/wp-content/uploads/2019/02/Capture-42.png?resize=678%2C213&amp;ssl=1" alt="" class="wp-image-10366"/></figure></div>



<h2 class="wp-block-heading">Using Record types</h2>



<p>If your org uses record types, picklist fields display values according to your record types. You must provide a record type ID using the <code>record-type-id</code> attribute if you have multiple record types on an object and you don’t have a default record type. Otherwise, the default record type ID is used. Display a record create a form based on a record type by providing the <code>record-type-id</code> attribute. This example shows a form that you can place on an account record page. The form displays fields, which include a picklist with values based on the given record type Id.</p>



<pre class="wp-block-code"><code>&lt;lightning-record-form object-api-name={objectApiName} record-type-id={recordTypeId}                 fields={fields}>&lt;/lightning-record-form></code></pre>



<h2 class="wp-block-heading">Error Message</h2>



<p>To enable automatic error handling, include the component <code>lightning-messages</code>.To customize the behavior of your form when it loads or when data is submitted, use the <code>onload</code> and <code>onsubmit</code> attributes to specify event handlers. Errors are automatically handled. To customize the behavior of the form when it encounters an error on submission or when data is submitted successfully, use the <code>onerror</code> and <code>onsuccess</code> attributes to specify event handlers</p>



<pre class="wp-block-code"><code>&lt;template>            
&lt;lightning-messages>&lt;/lightning-messages>     
&lt;lightning-record-form record-id={recordId} object-api-name="Account" layout-type="Full"     columns="2" mode="View" onsuccess={handleSuccess} onsubmit={handleSubmit}>    
&lt;/lightning-record-form>&lt;/template></code></pre>



<p>Source :  <a href="https://rajvakati.com/2019/02/16/lightning-record-form/">https://rajvakati.com/2019/02/16/lightning-record-form/</a> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.mhamzas.com/blog/2019/11/18/usage-of-lightning-record-form/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3015</post-id>	</item>
	</channel>
</rss>
