Which two ways allow the Architect to meet these requirements? - ProProfs Discuss
Topics
Products
Follow Us:

Which two ways allow the Architect to meet these requirements? Universal Containers has implemented a strict software architecture for their custom Apex code. One of the requirements is that all SOQL queries are 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”.



A. Create a SystemSOQLQueries class and a UserSOQLQueries class; set the “With Sharing” keyword on the UserSOQLQueries class and “Without Sharing” on the SystemSOQLQueries class
B. Create a reusable SOQLQueries class; do not specify “With” or “Without Sharing” on the SOQLQueries class
C. Create a reusable SOQLQueries class; do not specify “With” or “Without Sharing” on the SOQLQueries class and use the runAs () method to dynamically set the context
D. Create a reusable SOQLQueries class; specify “With Sharing” on the methods that require user context and “Without Sharing” on the methods requiring system context

This question is part of Salesforce Sharing and Visibility
Asked by Pjazurin, Last updated: Jun 01, 2020

+ Answer
Request

2 Answers

dan

Dan

Answered Mar 27, 2020

  • Create a reusable SOQLQueries class; do not specify “With” or “Without Sharing” on the SOQLQueries class.
  • Create a reusable SOQLQueries class; do not specify “With” or “Without Sharing” on the SOQLQueries class and use the runAs () method to dynamically set the context.
 

pjazurin

Pjazurin

Answered Jan 20, 2020

Create a reusable SOQLQueries class; do not specify “With” or “Without Sharing” on the SOQLQueries class
Create a reusable SOQLQueries class; do not specify “With” or “Without Sharing” on the SOQLQueries class and use the runAs () method to dynamically set the context
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.