Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
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.
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;'
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.
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;'
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.