SF-PD2 Testing, Debugging, and Deployment Practice Question
A developer deploys metadata to a production org using the Salesforce CLI. The deployment succeeds, but a post-deployment validation script that relies on a newly created custom setting record fails because the record is missing. The developer confirms the custom setting metadata was included in the package. What is the most likely explanation?
⚠ Common exam trap
The trap here is assuming that because custom setting metadata deployed successfully, its records were deployed too.
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
✓
Custom setting records are not deployable through Metadata API, so they must be inserted with Apex or the data loader after deployment.
Custom setting records are treated as data rather than metadata, so a deployment that includes the custom setting definition does not carry its records. The post-deploy script fails because it queries a record that was never inserted into production. The developer must load the record separately after the metadata deployment completes, typically through Anonymous Apex or the data loader.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Custom setting records are not deployable through Metadata API, so they must be inserted with Apex or the data loader after deployment.
Why this is correct
Custom setting records are data, not metadata, in the Metadata API sense. Although the custom setting object definition deploys with the package, its individual records are not carried by the deployment. A post-deploy script that expects a pre-populated record will therefore fail until the record is inserted separately via Apex, Anonymous Apex, or the data loader.
- ✗
The deployment ran with the --dry-run flag, which validates but does not commit custom setting records to the target org.
Why it's wrong here
A dry-run deployment would not have reported success for committing the package at all, and the scenario states the deployment succeeded. The missing record is not caused by a validation-only run; it is caused by custom setting records not being part of the deployable metadata payload.
- ✗
Custom setting records deploy only when the org has the Custom Settings license enabled on the target user's profile.
Why it's wrong here
There is no separate Custom Settings license that gates record deployment, and profile permissions affect access, not whether records are carried in a deployment. The record is absent because custom setting records are data that must be loaded after the metadata deploys, not because of a licensing or profile restriction.
- ✗
The post-deployment script ran before the custom setting metadata finished indexing, so the record existed but was not yet queryable.
Why it's wrong here
Deployments are synchronous: once a successful result is returned, metadata is committed and queryable. There is no asynchronous indexing window that would hide a deployed custom setting record. The record is missing because custom setting records are not deployed as metadata in the first place.
About these practice questions
Courseiva writes every SF-PD2 question from scratch — 226 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 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 SF-PD2 exam.