Avoid Using DML Operations In Apex Class Constructor/Init Method

< 1 min read

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

Updated on March 21, 2025
Was it helpful ?