System.LimitException: DML currently not allowed

DML operations are not allowed

1. Inside the constructor.

2. Method which is called from the constructor.

3. Check whether allowDML="true" is set in your apex:Component.

Cheers!!!

5 comments:

  1. Can i know why Dml doesn't works in Constructor ?

    ReplyDelete
  2. This might help
    https://developer.salesforce.com/forums?id=906F000000099dgIAA

    action parameter will do the work

    ReplyDelete
  3. If a method is called from get methods too will not allow DMLs...

    ReplyDelete