Loading tutorials
lightning-record-form is the quickest way to show, create, or edit a Salesforce record in a Lightning web component. You give it an object and, optionally, a record ID. It renders labelled fields, the buttons, and the save logic. This chapter builds three working forms (view, edit, and create) and5 min readlightning-record-form shows and how it arranges it: fields, layout-type and columns. It assumes you can write a basic LWC with @api properties and template bindings, and that you know Salesforce objects, fields and record IDs. The p5 min read@api properties and event handlers. It also assumes you have used lightning-record-form with a fields attribute or layout-type, and that you know what an object, a field and a record ID are. Here you will learn why importing field reference5 min readmode attribute of lightning-record-form. It assumes you can build a basic lightning-record-form with object-api-name, record-id and fields or layout-type, and that you know how @api properties and event handlers work in a Lightning Web Component.5 min readlightning-record-form fires while a user saves a record. It assumes you can build a basic LWC with templates, @api properties and event handlers. It also assumes you know what a record ID is and have used lightning-record-form in view or edit mode. You shoul5 min read@api property and an event handler. It also assumes you know what an object, a field and a record ID are, and that you have read the earlier chapter on how the form components use Lightning Data Servi5 min readlightning-record-edit-form wrap a set of fields. Here you will look at the three child components that go inside the form: what each one does, how it relates to Lightning Data Service (LDS), and where it commonly goes wrong.5 min readlightning-record-edit-form fires around loading and saving a record: load, success and error. It assumes you can already build a basic lightning-record-edit-form with lightning-input-field and lightning-messages, and that you know how LWC event4 min readlightning-record-edit-form with lightning-input-field components, and that you know how to handle its onsuccess and onerror events. It also assumes you are comfortable with LWC event handlers and this.template.querySelector.4 min readrecord-type-id controls which picklist values (and, for lightning-record-form, which layout) apply. density controls how labels and values are arranged. It assumes you can already build a `lightnin5 min read@api properties, and write event handlers. It also assumes you know how lightning-record-form and lightning-record-edit-form work, as covered in earlier chapters. Here you will learn how to pick among the base form compon5 min readlightning-record-form or lightning-record-edit-form and handle its onsuccess event. It also assumes you know how @wire and @api work. The question here is what happens to the other components on the page once a record is saved.5 min readlightning-record-form and lightning-record-edit-form. You should know how @api recordId, event handlers and @salesforce/schema imports work. Here you will learn what the form components cannot do, and how to diagnose the problems you will meet m6 min read