Below is my test code in short:

private class Test_IdaTimeLine_10Day {
    static testMethod void testVGRS()
        testTimeline(Constants.TURNAROUND_1DAY_REVPRIORITY, 'TEST-VGRS');

    private static void testTimeline(String turnaround, String jur) 
        List<Ida_Hearing__c> hearingList = [Select Id, Name From Ida_Hearing__c Limit 100];
        System.debug('hearingList length is: ' + hearingList.size());

And the result is: hearingList length is 100.

I am very surprised to see why this happens. Because I don't see anywhere in my code specifies seeAllData=true. What is the possible reason of it?

  • 4
    what is the api version of apex class?
    – Himanshu
    Oct 25, 2017 at 7:30

1 Answer 1


Short Answer: if the API version of your test class is 23.0 or below, its normal. The @IsTest(SeeAllData=true) annotation was released in version 24.0

According to Salesforce documentation https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_isTest.htm#SeeAllDataSectionTitle

For Apex code saved using Salesforce 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 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 API version 23.0 and earlier continues to have access to all data in the organization and its data access is unchanged

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .