+ Start a Discussion
imAkashGargimAkashGarg 

"DML currently not allowed" on PDF page

I have a VF page rendered as PDF.

I have to perform a DML operation on this page.

I am getting the error:

"DML currently not allowed"

 

How to perform a DML operation on this PDF page?

 

 

bob_buzzardbob_buzzard

Are you attempting DML in the constructor (or a getter)?  This isn't allowed I'm afraid.  I've blogged a workaround at:

 

http://bobbuzzard.blogspot.com/2011/08/dml-during-initialisation.html

 

is this any help?