Activity › Forums › Salesforce® Discussions › What is the use of with sharing and without sharing in Salesforce?

  • What is the use of with sharing and without sharing in Salesforce?

    Posted by Marziya on October 7, 2020 at 1:15 PM

    What is the use of with sharing and without sharing in Salesforce?

    Shweta replied 6 years ago 3 Members · 2 Replies
  • 2 Replies
  • Anjali

    Member
    October 7, 2020 at 1:19 PM

    With Sharing - Enforce the sharing rules that apply to current user. Without Sharing - Doesn't enforce the sharing rules.

  • [adinserter block='9']
  • Shweta

    Member
    October 13, 2020 at 3:45 PM

    We can use the with sharing keywords when declaring a class to enforce the sharing rules that apply to the current user.
    We can use the without sharing keywords when declaring a class to ensure that the sharing rules for the current user are not enforced<font color="#800000">.</font>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos