Delete ( D ) an Account Record

We are moving along toward the end of our CRUD example: Delete.

Let’s start fresh and refresh the VHE Second CRUD Sample application.

Again we will select Edit or Delete an Account.

Edit or Delete An Account

We no longer need our Acme test record, so let us type ‘Acme’ in the Account Name field and click on Search.

After the Acme Associates, Inc account is found, click on Delete.

Delete Acme Associates - Delete Button

After successful delete we get this toast message and are returned to our default account page:

Green Success Message - Record Is Deleted

The code progression starts with the LWC customSearch, which as shown above is a child of the LWC editOrDeleteAccount. customSearch has the Delete button, which calls a method in the controller called deleteAccount().

Code Segment: customSearch.html