Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Sharing and Visibility Designer All Questions

View all questions & answers for the Certified Sharing and Visibility Designer exam

Exam Certified Sharing and Visibility Designer topic 1 question 9 discussion

Actual exam question from Salesforce's Certified Sharing and Visibility Designer
Question #: 9
Topic #: 1
[All Certified Sharing and Visibility Designer Questions]

Cloud Kicks has the following setup and requirements:
A strict software architecture for their custom Apex code.
All SOQL queries must be contained within reusable classes.
Depending on the context of the Apex transaction, the queries should be able to run either “With Sharing” or “Without Sharing”.
What are two methods for meeting these requirements? (Choose two.)

  • A. 1. Create a SystemSOQLQueries class and a UserSOQLQueries class.
    2. Set the “With Sharing” keyword on the UserSOQLQueries class and “Without Sharing” on the SystemSOQLQueries class.
  • B. 1. Create a reusable SOQLQueries class.
    2. Specify “With Sharing” on the methods that require user context and “Without Sharing” on the methods requiring system context.
  • C. 1. Create a reusable SOQLQueries class.
    2. Do NOT specify “With” or “Without Sharing” on the SOQLQueries class and use the runAs() method to dynamically set the context.
  • D. 1. Create a reusable SOQLQueries class.
    2. Do NOT specify “With” or “Without Sharing” on the SOQLQueries class.
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Jokei
Highly Voted 1 year, 10 months ago
Selected Answer: AD
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm
upvoted 5 times
Jokei
1 year, 10 months ago
SOQLQueries class will inherit the sharing from the previous class.
upvoted 1 times
...
...
im_Sid
Most Recent 5 months, 1 week ago
B & C are the correct answers.
upvoted 1 times
...
karamba777
9 months, 2 weeks ago
as for me it's only D - inherit sharing will happen then
upvoted 1 times
...
mqvia
1 year, 1 month ago
Correct ans should be A,C ? Please correct me if wrong.
upvoted 1 times
...
pietrozb
1 year, 3 months ago
B does not make sense since "with sharing" and "without sharing" cannot be used in methods, otherwise an error is shown: "withSharing is not allowed on methods". The only valid answer is "A" in my opinion.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...