<apex:page standardController="Account" extensions="accountDelete" action="{!deleterecord}">
<apex:pageMessages />
</apex:page>
public with sharing class accountDelete {
apexpages.standardcontroller controller;
public accountDelete(ApexPages.StandardController controller) {
this.controller = controller;
}
public pagereference deleteRecord() {
try {
delete controller.getRecord();
return new pagereference(‘/home/home.jsp‘); //return new pagereference(‘/001/o‘); ----------执行完controller 后跳转到的页面;
} catch(exception e) {
apexpages.addmessages(e);
}
return null;
}
}
时间: 2024-10-07 00:47:45