function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ranu Jain SFDCRanu Jain SFDC 

with - without sharing in annonymous clock

If we execute annonymous block, code is run ion context of current user. My question is if we define a class in annonymou block as without sharing than also that class code will run in current user context?
Ramu_SFDCRamu_SFDC
Yes, as per the definition it runs in the current user context. The below post has more information on this

http://salesforce.stackexchange.com/questions/11768/when-to-use-with-sharing-or-without-sharing