SALESFORCE-PD1 Developer Fundamentals Practice Question
A developer implements a custom Apex controller for a Visualforce page that performs DML operations. Which THREE best practices should be followed to ensure robust data management and security? (Choose three.)
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Check object CRUD and field-level security permissions before executing DML.
Secure controllers must check CRUD/FLS, enforce sharing rules, and handle DML errors gracefully.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Check object CRUD and field-level security permissions before executing DML.
Why this is correct
Validating user permissions prevents unauthorized data modifications.
- ✓
Handle DML exceptions properly using try-catch blocks or Database methods.
Why this is correct
Proper exception handling prevents unhandled runtime errors from crashing the user interface.
- ✓
Enforce sharing rules by using 'with sharing' on the controller class.
Why this is correct
'with sharing' ensures data visibility respects organization-wide sharing settings.
- ✗
Hardcode record type IDs directly in the controller class.
Why it's wrong here
Hardcoding IDs causes deployment failures between sandboxes and production environments.
- ✗
Bypass all triggers by using custom settings during Visualforce execution.
Why it's wrong here
Bypassing triggers globally is an anti-pattern that circumvents business logic.
About these practice questions
This SALESFORCE-PD1 question is part of Courseiva's 493-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Salesforce exam blueprint
This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.