Avoid using DML operations in Apex class constructor/init method

Impact area

Security

Severity

High

Affected element

Apex Class

Rule ID

SF-0023

Impact

Using DML statements in constructors can result in data modification just by accessing a page.


Remediation

Remove DML code from constructors / init methods.

Time to fix

60 min

What's here


Related content

PMD - Apex Class rules

PMD: ApexCSRF





Last modified on Jun 10, 2020