You need to sign in to do that
Don't have an account?
![sdu sdu](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Why test code cannot see data in sfLMA__License__c??
There are lots of rows in this object, but when I run a query from it in a test method, it is not seeing any rows. Why? How am I suppose to test my code if I cannot see the data??
Hi,
In recent release (may be winter or spring 12), test methods has come up with new annotation.
@isTest(SeeAllData=true)
when you set "SeeAllData" = true you will be able to get your organizations data in the test code. (Default value is false).
Also it is best practice to create your own data instead of querying it from the org. Hope this helps you.
All Answers
Hi,
In recent release (may be winter or spring 12), test methods has come up with new annotation.
@isTest(SeeAllData=true)
when you set "SeeAllData" = true you will be able to get your organizations data in the test code. (Default value is false).
Also it is best practice to create your own data instead of querying it from the org. Hope this helps you.
Thanks, this solved my problem!