New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

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