Create ( C ) an Account

If we select the first option Create an Account, a new form appears below the radio options. This new form is also an LWC. It is displayed using conditional rendering in the HTML Template file.

Vhe2ndCrud-CreateAnAccount

The new LWC is named createAccount, and it is a child component of the homepage component.

NOTE: createAccount, as a complete Lightning Web Component, is reusable and independent. It can be included in any number of applications or can standalone in a Lightning App page.

When a user enters values in these fields and clicks on the Create button, the saveAccountRec() function in JavaScript controller is called. saveAccountRec() takes the user input from the Template form, bundles them into an object and passes that object as a parameter to the createRecord() function.

Code Segment: createAccount.html