{"id":114,"date":"2022-10-12T02:49:39","date_gmt":"2022-10-11T21:49:39","guid":{"rendered":"http:\/\/doozyspot.com\/?p=114"},"modified":"2022-10-12T22:02:10","modified_gmt":"2022-10-12T17:02:10","slug":"lightning-record-edit-form","status":"publish","type":"post","link":"https:\/\/doozyspot.com\/?p=114","title":{"rendered":"Salesforce Lightning Record Edit Form &#8211; Aura and LWC"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>LWC way\n&lt;lightning-record-edit-form\n    object-api-name={objectApiName}\n    record-id={recordId}\n&gt;\n    &lt;lightning-input-field field-name={nameField}&gt; &lt;\/lightning-input-field&gt;\n    &lt;div class=\"slds-var-m-top_medium\"&gt;\n        &lt;lightning-button variant=\"brand\" type=\"submit\" label=\"Save\"&gt;\n        &lt;\/lightning-button&gt;\n    &lt;\/div&gt;\n&lt;\/lightning-record-edit-form&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>AURA Way\n&lt;aura:component&gt;\n    &lt;lightning:recordEditForm recordId=\"003XXXXXXXXXXXXXXX\" objectApiName=\"Contact\"&gt;\n        &lt;lightning:messages \/&gt;\n        &lt;lightning:outputField fieldName=\"AccountId\" \/&gt;\n        &lt;lightning:inputField fieldName=\"FirstName\" \/&gt;\n        &lt;lightning:inputField fieldName=\"LastName\" \/&gt;\n        &lt;lightning:inputField fieldName=\"Email\" \/&gt;\n        &lt;lightning:button class=\"slds-m-top_small\" variant=\"brand\" type=\"submit\" name=\"update\" label=\"Update\" \/&gt;\n    &lt;\/lightning:recordEditForm&gt;\n&lt;\/aura:component&gt;<\/code><\/pre>\n\n\n\n<p>use record edit form component to create a form that&#8217;s used to add a Salesforce record or update fields in an existing record on an object. The component displays fields with their labels and the current values and enables you to edit their values.<\/p>\n\n\n\n<p><code>lightning record edit form<\/code>&nbsp;supports the following features.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Editing a record&#8217;s specified fields, given the record ID.<\/li><li>Creating a record using specified fields.<\/li><li>Customizing the form layout<\/li><li>Custom rendering of record data<\/li><\/ul>\n\n\n\n<p><code>lightning record edit form<\/code>&nbsp;implements Lightning Data Service and doesn&#8217;t require additional Apex controllers to create or update record data. This component also takes care of field-level security and sharing for you, so users see only the data they have access to.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Common Errors &#8211; why fields are not loaded in record edit form<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>User does not have access to those fields<\/li><li>Object name in the attribute object-api-name={objectApiName} or ObjectApiName=&#8221;Account&#8221; is not valid<\/li><li>Onload error<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>use record edit form component to create a form that&#8217;s used to add a Salesforce record or update fields in an existing record on an object. The component displays fields with their labels and the current values and enables you to edit their values. lightning record edit form&nbsp;supports the following features. Editing a record&#8217;s specified [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8,9],"tags":[13,14,5],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-aura","category-salesforce","tag-aura","tag-lwc","tag-salesforce"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Salesforce Lightning Record Edit Form - Aura and LWC - DoozySpot<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/doozyspot.com\/?p=114\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Salesforce Lightning Record Edit Form - Aura and LWC - DoozySpot\" \/>\n<meta property=\"og:description\" content=\"use record edit form component to create a form that&#8217;s used to add a Salesforce record or update fields in an existing record on an object. The component displays fields with their labels and the current values and enables you to edit their values. lightning record edit form&nbsp;supports the following features. Editing a record&#8217;s specified [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/doozyspot.com\/?p=114\" \/>\n<meta property=\"og:site_name\" content=\"DoozySpot\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-11T21:49:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-12T17:02:10+00:00\" \/>\n<meta name=\"author\" content=\"doozyspot\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"doozyspot\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/doozyspot.com\/?p=114#article\",\"isPartOf\":{\"@id\":\"https:\/\/doozyspot.com\/?p=114\"},\"author\":{\"name\":\"doozyspot\",\"@id\":\"https:\/\/doozyspot.com\/#\/schema\/person\/bccb52398479b1354683df33f84154d6\"},\"headline\":\"Salesforce Lightning Record Edit Form &#8211; Aura and LWC\",\"datePublished\":\"2022-10-11T21:49:39+00:00\",\"dateModified\":\"2022-10-12T17:02:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/doozyspot.com\/?p=114\"},\"wordCount\":156,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/doozyspot.com\/#organization\"},\"keywords\":[\"Aura\",\"LWC\",\"Salesforce\"],\"articleSection\":[\"Aura\",\"Salesforce\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/doozyspot.com\/?p=114#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/doozyspot.com\/?p=114\",\"url\":\"https:\/\/doozyspot.com\/?p=114\",\"name\":\"Salesforce Lightning Record Edit Form - Aura and LWC - DoozySpot\",\"isPartOf\":{\"@id\":\"https:\/\/doozyspot.com\/#website\"},\"datePublished\":\"2022-10-11T21:49:39+00:00\",\"dateModified\":\"2022-10-12T17:02:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/doozyspot.com\/?p=114#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/doozyspot.com\/?p=114\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/doozyspot.com\/?p=114#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/doozyspot.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Salesforce Lightning Record Edit Form &#8211; Aura and LWC\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/doozyspot.com\/#website\",\"url\":\"https:\/\/doozyspot.com\/\",\"name\":\"DoozySpot\",\"description\":\"One of its kind in knowledge base\",\"publisher\":{\"@id\":\"https:\/\/doozyspot.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/doozyspot.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/doozyspot.com\/#organization\",\"name\":\"DoozySpot\",\"url\":\"https:\/\/doozyspot.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/doozyspot.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/doozyspot.com\/wp-content\/uploads\/2023\/03\/download.jpg\",\"contentUrl\":\"http:\/\/doozyspot.com\/wp-content\/uploads\/2023\/03\/download.jpg\",\"width\":1200,\"height\":1200,\"caption\":\"DoozySpot\"},\"image\":{\"@id\":\"https:\/\/doozyspot.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/doozyspot.com\/#\/schema\/person\/bccb52398479b1354683df33f84154d6\",\"name\":\"doozyspot\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/doozyspot.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2584f56a7b7945fd49a8fdf22dd31fa7baf3cf6f10370736f2d2895c7d9219f4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2584f56a7b7945fd49a8fdf22dd31fa7baf3cf6f10370736f2d2895c7d9219f4?s=96&d=mm&r=g\",\"caption\":\"doozyspot\"},\"sameAs\":[\"http:\/\/doozyspot.com\"],\"url\":\"https:\/\/doozyspot.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Salesforce Lightning Record Edit Form - Aura and LWC - DoozySpot","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/doozyspot.com\/?p=114","og_locale":"en_US","og_type":"article","og_title":"Salesforce Lightning Record Edit Form - Aura and LWC - DoozySpot","og_description":"use record edit form component to create a form that&#8217;s used to add a Salesforce record or update fields in an existing record on an object. The component displays fields with their labels and the current values and enables you to edit their values. lightning record edit form&nbsp;supports the following features. Editing a record&#8217;s specified [&hellip;]","og_url":"https:\/\/doozyspot.com\/?p=114","og_site_name":"DoozySpot","article_published_time":"2022-10-11T21:49:39+00:00","article_modified_time":"2022-10-12T17:02:10+00:00","author":"doozyspot","twitter_card":"summary_large_image","twitter_misc":{"Written by":"doozyspot","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/doozyspot.com\/?p=114#article","isPartOf":{"@id":"https:\/\/doozyspot.com\/?p=114"},"author":{"name":"doozyspot","@id":"https:\/\/doozyspot.com\/#\/schema\/person\/bccb52398479b1354683df33f84154d6"},"headline":"Salesforce Lightning Record Edit Form &#8211; Aura and LWC","datePublished":"2022-10-11T21:49:39+00:00","dateModified":"2022-10-12T17:02:10+00:00","mainEntityOfPage":{"@id":"https:\/\/doozyspot.com\/?p=114"},"wordCount":156,"commentCount":0,"publisher":{"@id":"https:\/\/doozyspot.com\/#organization"},"keywords":["Aura","LWC","Salesforce"],"articleSection":["Aura","Salesforce"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/doozyspot.com\/?p=114#respond"]}]},{"@type":"WebPage","@id":"https:\/\/doozyspot.com\/?p=114","url":"https:\/\/doozyspot.com\/?p=114","name":"Salesforce Lightning Record Edit Form - Aura and LWC - DoozySpot","isPartOf":{"@id":"https:\/\/doozyspot.com\/#website"},"datePublished":"2022-10-11T21:49:39+00:00","dateModified":"2022-10-12T17:02:10+00:00","breadcrumb":{"@id":"https:\/\/doozyspot.com\/?p=114#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/doozyspot.com\/?p=114"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/doozyspot.com\/?p=114#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/doozyspot.com\/"},{"@type":"ListItem","position":2,"name":"Salesforce Lightning Record Edit Form &#8211; Aura and LWC"}]},{"@type":"WebSite","@id":"https:\/\/doozyspot.com\/#website","url":"https:\/\/doozyspot.com\/","name":"DoozySpot","description":"One of its kind in knowledge base","publisher":{"@id":"https:\/\/doozyspot.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/doozyspot.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/doozyspot.com\/#organization","name":"DoozySpot","url":"https:\/\/doozyspot.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/doozyspot.com\/#\/schema\/logo\/image\/","url":"http:\/\/doozyspot.com\/wp-content\/uploads\/2023\/03\/download.jpg","contentUrl":"http:\/\/doozyspot.com\/wp-content\/uploads\/2023\/03\/download.jpg","width":1200,"height":1200,"caption":"DoozySpot"},"image":{"@id":"https:\/\/doozyspot.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/doozyspot.com\/#\/schema\/person\/bccb52398479b1354683df33f84154d6","name":"doozyspot","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/doozyspot.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2584f56a7b7945fd49a8fdf22dd31fa7baf3cf6f10370736f2d2895c7d9219f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2584f56a7b7945fd49a8fdf22dd31fa7baf3cf6f10370736f2d2895c7d9219f4?s=96&d=mm&r=g","caption":"doozyspot"},"sameAs":["http:\/\/doozyspot.com"],"url":"https:\/\/doozyspot.com\/?author=1"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/doozyspot.com\/index.php?rest_route=\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doozyspot.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doozyspot.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doozyspot.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doozyspot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=114"}],"version-history":[{"count":4,"href":"https:\/\/doozyspot.com\/index.php?rest_route=\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":132,"href":"https:\/\/doozyspot.com\/index.php?rest_route=\/wp\/v2\/posts\/114\/revisions\/132"}],"wp:attachment":[{"href":"https:\/\/doozyspot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doozyspot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doozyspot.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}