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
Prevent all constructors from writing in to the database, so that creation of objects does not have any data-altering side-effects.
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