Exam PDI Topic 3 Question 99 Discussion

Actual exam question for Salesforce's PDI exam
Question #: 99
Topic #: 3
Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own.
What should the developer use to enforce sharing permissions for the currently logged in user while using the custom search tool?

Suggested Answer: A Vote an answer

Thewith sharingkeyword ensures that the Apex class respects the sharing rules of the current user, including private sharing models. This means the logged-in user will only see records they own or have been shared with them.
Reference:Apex Class Sharing Rules
Incorrect Options:
B:without sharingignores sharing rules, exposing data the user does not have access to.
C:Filtering withUserInfois not a scalable or maintainable solution.
D:Schema describe calls do not enforce sharing permissions but only check object-level access.

by Geoff at Jun 29, 2026, 01:37 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10