Activity Forums Salesforce® Discussions why salesforce introduced without sharing keyword,but apex class run on the system mode? Reply To: why salesforce introduced without sharing keyword,but apex class run on the system mode?

  • Shubham

    Member
    August 23, 2017 at 9:38 am

    Hello Uday

    If a class is call by(or call) another class which enforce sharing rule(with sharing) then its automatically enforced sharing rule.In this situation if we want that our class don't acquire sharing then we use 'without sharing'  Keyword.

    E.g.

    ****Sharing Class****

    public with sharing class sharing{

    }

    ****Class Call(or Call by) Sharing Class****

    public without sharing class  notsharing{

    }