You need to sign in to do that
Don't have an account?
By Default which sharing rule will apply on Apex??
In class declaration if we don’t write keyword “with sharing” then it runs in system mode then why keyword “without sharing” is introduced in apex?
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_keywords_sharing.htm
All Answers
With/without sharing indicates whether the sharing rules for the currently logged in user should be applied when accessing records. The permissions of the currently logged in user are ignored regardless of with/without sharing, as the code is still running in system mode.
According to you by default it is with Sharing.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_keywords_sharing.htm
I have still doubt if Run in system mode then what is difference between without sharing & system mode. Please explain.?
If any of (with/without) by default then why we have to write it or there may be difference between default and with/without..
Thanks
Ashok
Thus running in system context means you can view sobject types that your profile doesn't allow, but with sharing stops you seeing any records that haven't been shared with yout.