Activity Forums Salesforce® Discussions Difference between 'with sharing' and 'without sharing'?

  • Himanshu

    Member
    July 28, 2016 at 8:15 am

    Hi Mohit,

     

    Without Sharing: the code runs in system context; all records and fields are available for use.Sharing rules are not applied for the current user.

    With Sharing: the code runs in user context; DML operations may fail because of sharing settings, and queries will only return values available to the user.sharing rules for the current user are enforced

    System Context: the code has full access to all records and fields in the system.

    User Context: the code can only access records (and possibly fields, such as executeAnonymous calls) available to the user.

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos