Tuesday, August 12, 2014

Why is DML not allowed in Constructor's in Salesforce?

Why is DML not allowed in Constructor's in Salesforce? 


Constructor is mainly used to initialization of variables. It is not used for doing DML operations.

Salesforce has blocked this due to security issues.

If you want to do DML operation during VF page loading, use action attrirbute in <apex:page>. Call a method from the action in which DML operation is allowed.




1 comments:

Unknown said...

Can you help to Call a method from the action in which DML operation is allowed.

Post a Comment

 
| ,