what is the use of SeeAllData=true in isTest?

what is the use of SeeAllData=true in isTest?

    In test class and methods, we can access data in the organization. Prior to it we can just access test data. Using this we can access organization data.

    For Apex code saved using Salesforce.com API version 24.0 and later, use the isTest(SeeAllData=true) annotation to grant test classes and individual test methods access to all data in the organization, including pre-existing data that the test didn’t create.

    Starting with Apex code saved using Salesforce.com API version 24.0, test methods don’t have access by default to pre-existing data in the organization. However, test code saved against Salesforce.com API version 23.0 or earlier continues to have access to all data in the organization and its data access is unchanged.

Cheers!!!

Leave a Reply