SALESFORCE-PD1 Developer Fundamentals Practice Question
A developer writes an Apex method with the 'inherited sharing' keyword. What is the behavior of this class when invoked from a class declared with 'with sharing'?
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
✓
It enforces sharing rules because the calling class has 'with sharing'.
Inherited sharing classes execute with sharing when invoked from a with sharing context, inheriting the caller's sharing rules.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
It throws a compilation error because sharing modes conflict.
Why it's wrong here
Inherited sharing is specifically designed to interoperate safely.
- ✗
It executes in system mode without enforcing sharing rules.
Why it's wrong here
That is the behavior of without sharing.
- ✓
It enforces sharing rules because the calling class has 'with sharing'.
Why this is correct
Inherited sharing adopts the context of the calling code.
- ✗
It prompts the user to select a sharing mode at runtime.
Why it's wrong here
Sharing mode is determined statically by the execution stack, not user prompts.
About these practice questions
Courseiva writes every SALESFORCE-PD1 question from scratch — 493 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 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.