Salesforce Certified Sharing and Visibility Architect — Question 3

Universal Containers (UC) has a custom Apex class that enforces a business process and updates opportunities. UC has noticed that fields with field-level security permission of read only on certain users’ profiles are being updates by this class.
How should the architect fix this problem?

Answer options

Correct answer: A

Explanation

The correct answer is A because using the WITH SECURITY_ENFORCED keyword ensures that the SOQL query respects field-level security, preventing updates to fields that should be read-only. Options B and D do not address the issue directly with respect to SOQL, while option C does not inherently enforce field-level security but merely checks for updatability.