You need to sign in to do that
Don't have an account?
sfdc fresher
what is the significance of with out sharing
hi everyone,
why we need to mention without sharing keyword, eventhough by default it is without sharing
why we need to mention without sharing keyword, eventhough by default it is without sharing
Even though a class without any sharing keyword by default is without sharing, the calling class will determine.
If a with sharing class calls a class without any sharing keywords, then sharing rules are enforced.
If a with sharing class calls a class with without sharing a keyword, then sharing rules are not enforced.
Please check once below URLs:
https://pritamshekhawat.wordpress.com/2015/07/13/with-sharing-without-sharing-keywords-in-apex/
https://www.salesforcetutorial.com/with-sharing-without-sharing-keywords/
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For Salesforce Project Support: varaprasad4sfdc@gmail.com
Salesforce latest interview questions :
https://www.youtube.com/channel/UCOcam_Hb4KjeBdYJlJWV_ZA?sub_confirmation=1
Please refer the following links
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm
https://developer.salesforce.com/forums/?id=906F000000091XwIAI
https://salesforce.stackexchange.com/questions/16121/sfdc-understanding-with-sharing-without-sharing-unspecified-sharing-classes/16123
Thanks
By defaults all the apex class are determined as without sharing. The main agenda to use the keyword with sharing and without sharing is as followed :
If a with sharing class calls a class without any sharing keywords, then sharing rules are enforced.
If a with sharing class calls a class with without sharing a keyword, then sharing rules are not enforced.
Regards
Rajesh