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
MaxFrielMaxFriel 

"DML currently not allowed" work around....

All,

I am currently working on an integration project with a third party utility.  I have the connector setup to write any errors with the connection to an object.  The issue that comes up is there are some VF page controllers that have call outs in the contructor to get the needed information to display on the page.  If this call out fails, it attempts to write an error to the error object and gets the error "DML currently not allowed".  I know I could retool the thing to save the error and then call an action on the page to save it, but that would force into having multiple functions to do basically the same thing and have multiple points of maintence going forward.  Just wondering if anyone had a better idea.  

Bhawani SharmaBhawani Sharma
Put DML is separate method and use action attribute on page level to call this method.