Which sharing context will Mymethod execute when it is invoked? - ProProfs Discuss
Advertisement

Which sharing context will Mymethod execute when it is invoked?

Asked by Wyatt Williams, Last updated: Mar 30, 2024

+ Answer
Request
Question menu
Vote up Vote down

3 Answers

jithinu90

jithinu

jithinu90
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.
upvote downvote
Reply 

M. Kennedy

M. Kennedy

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 whether “with sharing” or “without sharing” should be used. In regard to “with sharing” keyword, the inner class does not inherit the sharing setting from the container class. This is because it must be set by the user.

upvote downvote
Reply 

Wyatt Williams

Wyatt Williams

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

*##**##*
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

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