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
JR NonprofitJR Nonprofit 

DML Error Message

I'm displaying a detail page for a custom object on a visual force page.  I have displayed the standard delete button on the detail page and have added a custom delete button on the detail page as well (I know that sounds dumb, but I'm doing some testing).
 
At any rate, when I click the standard delete button, the record is properly deleted.   When I press the custom delete button, a visual force page is loaded which uses a custom controller (I've tried a controller extension as well and the behavior is the same).  If its not OK to delete the page, I display an error message explaining the problem.  If its OK to delete the page, I issue a "delete record" line in the apex controller and get a "DML currently not allowed" page.
 
Anybody know what's going on here?
 
Thanks for your help,
Jeff
 
David VPDavid VP
Are you doing the 'delete' in the constructor of you controller ?
If yes, see this link



David


JR NonprofitJR Nonprofit
Yes, I was trying to do as you described.  I have now corrected the code.
 
Thanks for your help.