Activity Forums Salesforce® Discussions What is the use of SeeAllData = True in test class in salesforce?

  • Nikita

    Member
    November 11, 2019 at 1:33 pm

    Hi Laveena,

    use the isTest(SeeAllData=true) annotation to grant test classes and individual test methods access to all data in the organization,
    1) If a test class is defined with the isTest(SeeAllData=true) annotation, this annotation applies to all its test methods whether the test methods are defined with the @isTest annotation or the test method keyword
    2) The isTest(SeeAllData=true) annotation is used to open up data access when applied at the class or method level

  • Piyush

    Member
    November 11, 2019 at 1:34 pm

    Hi,

    The @isTest(SeeAllData=true) annotation is used to open up data access when applied at the class or method level. However, if the containing class has been annotated with @isTest(SeeAllData=true) , annotating a method with @isTest(SeeAllData=false) is ignored for that method.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos