Activity Forums Salesforce® Discussions Difference between seeallData=true and seeAllData =false ?

  • Difference between seeallData=true and seeAllData =false ?

    Posted by Suraj on April 18, 2017 at 12:37 pm

    What is the Difference between seeallData=true and seeAllData =false?

    Manpreet replied 7 years ago 2 Members · 1 Reply
  • 1 Reply
  • Manpreet

    Member
    April 18, 2017 at 1:23 pm

    Hi suraj,

    IsTest(SeeAllData=true) : 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 testmethod keyword
    2) The isTest(SeeAllData=true) annotation is used to open up data access when applied at the class or method level

    Use the isTest(SeeAllData=true) means you need to create the test data in your org.

    User, profile, organization, AsyncApexjob, Corntrigger, RecordType, ApexClass, ApexComponent ,ApexPage we can access without (seeAllData=true) .
    SeeAllData=true will not work for API 23 version eailer .

    NOTE:- Always try to avoid use SeeAllData= true because in that case your test class depend on your sandbox data. You May get some issue will deployment.

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos