function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vinni shreevinni shree 

seealldata=true for profile or report

Hi,

 To test the org data in the test class for which sobject we use seeAllData= true. Is it for profile or report. I worked for report ewith seealldata =true but few resources mentioned profile don't need seealldata=true for test class we can directly get the org data.Please clarify 

Thank you

Best Answer chosen by vinni shree
VinayVinay (Salesforce Developers) 
Hi Vinni,

It depends on your controller on if you want to use seealldata=true or no.  Annotate your test class or test method with IsTest(SeeAllData=true) to open up data access to records in your organization. The IsTest(SeeAllData=true) annotation applies to data queries but doesn't apply to record creation or changes, including deletions. New and changed records are still rolled back in Apex tests even when using the annotation.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_seealldata_using.htm

Please mark as Best Answer if above information was helpful.

Thanks,