Rationale
The act of creation of an object should not alter significant data on the server side or have other significant side-effects. For this reason using DML statements inside constructors is generally considered unsafe.
Scope
Apex classes
The act of creation of an object should not alter significant data on the server side or have other significant side-effects. For this reason using DML statements inside constructors is generally considered unsafe.
Apex classes