You need to sign in to do that
Don't have an account?
Custom setting not accessible from test class
i have a List custom setting defined.
There is a button on the accounts page, which redirects to an URL.
the URL is generated from a class which returns the URL.
This class uses the custom setting values.
the button is working fine, also i am getting the right result even on changing the custom setting value.
The problem comes in the test class:
it says:
"Null Pointer Exception: Argument 1 cannot be null"
The custom setting has default values, i.e. is accessible to anyone.
The code is like:
EncryptionVariables__c CS = EncryptionVariables__c.getInstance('Org');
return Blob.valueOf(CS.MyAESKey__c);
Need Help
issue solved!! :)
just changes ur version to 23.0 ( I faced the same issue today :P)
this is due to 24.0 version
Thanks
Rahul
404-314-2068
All Answers
chk Custom setting values in MyAESKey__c is it of string datatype?
use syste.debug()
issue solved!! :)
just changes ur version to 23.0 ( I faced the same issue today :P)
this is due to 24.0 version
Thanks
Rahul
404-314-2068
hey super.... thanks a lot!
its working :)
does the change of version affect my code?
does that mean the code is not supported in v24?
Looks like this is an issue with accessing custom settings values in test class for API 24. check this link for detail
Use