What is the accurate statement about with sharing keyword? - ProProfs Discuss
Topics
Products
Follow Us:

What is the accurate statement about with sharing keyword?



A. Inner class do not inherit the sharing setting from the container class
B. Both inner and outer class can be declared as with sharing
C. Either inner class or outer classes can be declared as with sharing but not both
D. Inner class inherit the sharing setting from the container class

This question is part of Salesforce Platform Developer 1
Asked by Wyatt Williams, Last updated: Jan 22, 2020

+ Answer
Request

3 Answers

jithinu

Jithinu

Answered Apr 17, 2019

  • Both inner classes and outer classes can be declared aswith sharing. The sharing setting applies to all code contained in the class, including initialization code, constructors, and methods.
  • Inner classes donotinherit the sharing setting from their container class.
 

M. Kennedy

M. Kennedy, Web Content Writer, Denver

Answered Oct 16, 2018

The term “with sharing” is used in the Salesforce program for businesses to use to maintain and market their companies and their companies’ products. If this term is not used, then the sharing rules for this user can’t be used for a certain class. This term has to be used in order to allow access into an account for a class with the sharing rules. Most things are accessed in the system context through the Apex code. It is important for the user to designate whe...Read More
 

Wyatt Williams

Wyatt Williams

Answered Nov 06, 2017

Inner class do not inherit the sharing setting from the container class
Both inner and outer class can be declared as with sharing

####
 

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.