Tuesday, 7 August 2012

Access to object in a test class

Questions:
* There are few test classes where I am running under different users
 
* When I am quering objects I am getting 0 rows.  

*For example  the custom object Book__c where I looked at sharing I see this.

         Pipeline Stage
       Public Read OnlyChecked
 ------------------------------------------------------
Solution:
* Use the "IsTest(SeeAllData=true) Annotation" annotation in test class to fetch the record. 

Refer:

No comments:

Post a Comment

Labels