HTML
<template>
<lightning-button variant="destructive"
label="Delete"
icon-name="utility:delete"
icon-position="right"
onclick={deleteRecord}>
</lightning-button>
</template>
Java Script
import { LightningElement, api, track } from 'lwc';
import { deleteRecord } from 'lightning/uiRecordApi';
export default class DeleteAccount extends LightningElement {
@api recordId ='0038b00002in40SAAQ';
@api objectApiName;
deleteRecord() {
deleteRecord(this.recordId)
.then(() => {
console.log('Record is deleted successfully');
})
.catch(error => {
console.error(error);
});
}
}
Video
Video does not exists.