You need to sign in to do that
Don't have an account?
geetforce
getting NULL from Custom Settings in Test class
Hi All, I wrote a test case where I am fetching values from Custom Settings by executing "My_Settings.getValues('Test').myVal__c" statement. Here I am getting NULL POINTER ERROR because "My_Settings.getValues('Test')" line is retuning NULL value but I am getting value when I execute same statement in my controller class even when I tried the same line in Developer console I am getting correct value. I have no idea why I am getting NPE here in the test case where the same test case was working from last month and no buddy modified anything here or any of dependent objects. Does anyone are facing same issue or any one have any idea how to fix this.
Are you using api24.0?
if so, you may need to set (seealldata=true);
All Answers
Are you using api24.0?
if so, you may need to set (seealldata=true);
Hi,
I am having a similar problem. Can you check the post at.
http://boards.developerforce.com/t5/Apex-Code-Development/Custom-Setting-data-causing-problem-in-Test-method/td-p/409391
Thanks,
Jerun Jose