function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vagishvagish 

delete functionality

Hi,

        Is there any standard method to delete any record.

 

like {!save} (used fof save), it saves any record, I need same functionality for deletion.

Damien_Damien_

MyRecord__c rec = [select name from MyRecord__c WHERE id =: recid];

delete rec;

//This gives the general idea on what to do.  Put the record into an sObject then simply  do 'delete recordname;'

sfdcfoxsfdcfox

The StandardController provides a {!delete} method that will delete the record stored in the controller. Please see StandardController in the documentation for all available methods.