I have created a Protected/List custom setting object in my org (not a managed package)
It's Custom fields are:
I created a dataset named: test
with relevant values (I had another dataset with a ' ' space, thought this causes the problem.
When I try to access the dataset from APEX, I keep getting Null reference error.
System.NullPointerException: Attempt to de-reference a null object (error in line 15)
Code snippet: (code is in apex class - not @test)
14: Netsuite_Integration__c m_nsi = Netsuite_Integration__c.getValues('test');
ERROR LINE: 15: system.debug('15 m_nsi.NS_Email__c:' + m_nsi.NS_Email__c);
Already tried:
- Already Tried getValues, getInstance
- Recreated the object again in Sandbox (known issue)
- Created several datasets with different names (removed space)
While coding, developer console does recognizes, and autocompletes
ideas?
seealldata=true
attribute (which I don't recommend) then the test will not be able to access this data. You would need to create the custom setting record within your test, or inside a@testsetup
method.