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
NarenKNarenK 

Unable to get custom setting values while testing in SandBox env

Hi All, Recently I encountered a strange problem on SandBox environment. I am unable to get the values present in a custom settings while running test cases where as If I am running same test cases in Dev environment I am able to get the values. Any idea why it is behaving differently on Dev and SandBox env? Thanks in advance for your help! Regards, Naren
Best Answer chosen by Admin (Salesforce Developers) 
NarenKNarenK

Thanks for letting me know. Me aslo just finded out from API version24 (Spring 2012) test cases are not allowd to use existing data in organization. They have to prepare data in test cases it self. Found this info on http://astreait.com/starting-with-spring-12-apex-test-cases-will-not-have-access-to-org-data/.

 

 

Thanks,

Naren

All Answers

AnnuAnnu

Hi,

 

Go to corresponding test class where you are facing the problem. click Edit -> click on Version Settings and select the version same as your Dev org version (It  Should be API Version 23.). Please check the Version and set the proper version.

 

Let me know if it answers your question.

 

Thank you

Annu.

NarenKNarenK

Thanks for letting me know. Me aslo just finded out from API version24 (Spring 2012) test cases are not allowd to use existing data in organization. They have to prepare data in test cases it self. Found this info on http://astreait.com/starting-with-spring-12-apex-test-cases-will-not-have-access-to-org-data/.

 

 

Thanks,

Naren

This was selected as the best answer