💬 In plain words: You do not always need to write an Apex controller to manipulate data in Salesforce! Lightning Web Components (LWC) provide built-in JavaScript functions called createRecord and deleteRecord . These functions talk directly to the Salesforce database using the Lightning Data Service (LDS), allowing you to build faster, lighter UI components with less code. When building custom user interfaces on the Salesforce platform, reducing server-side code is a major best practice. Writing an Apex class just to insert a single Account or delete a Contact introduces unnecessary maintenance overhead and testing requirements. By using the lightning/uiRecordApi module, your LWC can execute DML operations directly from the browser while automatically respecting the active user's security permissions.
Topic
LWC
Lightning Web Components