So I understand DML Operations aren't allowed in getters/setters,constructors but it was my understanding that they were allowed in methods that were invoked by page-actions like so:
page:
<apex:page controller="mycontroller" action="{!init}">...</apex:page>
controller:
public mycontroller(){
public void init(){
//perform some DML, in my case inserting a custom setting if one doesn't exist...
insert whatever...;
}
}
This worked fine for a while, but than when I attempted to deploy my app into a Spring '13 sandbox org I get an exception:
DML currently not allowed An unexpected error has occurred. Your development organization has been notified.
Has this always been the case and I'm doing something different I didn't realize?
If not some suggestions how I could create my necessary custom settings if they don't exist on page-init would be great.