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
AjjuAjju 

if we don't write withsharing in class,then it will be withoutsharing right,then what is the use of writing withoutsharing again introduced in salesforce ?

Best Answer chosen by Ajju
Ashish_SFDCAshish_SFDC
Hi Ajju, 


Class is by default executed in System mode means which does not consider User Level Sharing. 

To Override that we use With Sharing keyword to override the default sharing execution. 

See the doc below, 

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_keywords_sharing.htm

And there are few other components which execute in User mode by default to override those classes we use Without Sharing keywords. 


Regards,
Ashish