+ 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