Salesforce Platform Developer I (legacy) — Question 180
In the following example, which sharing context myMethod execute when it is invoked?
public Class myClass {
public void myMethod() { /* implementation */ }
}
Answer options
- A. Sharing rules will not be enforced for the running user.
- B. Sharing rules will be inherited from the calling context.
- C. Sharing rules will be enforced for the running user.
- D. Sharing rules will be enforced by the instantiating class.
Correct answer: A
Explanation
The correct answer is A because the method myMethod does not have any sharing rules applied, meaning the running user will not be restricted by them. Options B, C, and D suggest that sharing rules apply in some manner, which is not the case here.