You need to sign in to do that
Don't have an account?
Custom Settings and Workflow causing Internal Server Error in Unit Tests
I have a Workflow that is settings fields using formula's that reference Custom Settings fields. UI all works OK. Apex Tests are causing an internal server error.
If I mark the test SeeAllData=True then, rather than creating the Custom Setting as part of the test data setup then all ok. Create a new Custom Setting as part of test data markup - Internal Server Error.
Any ideas welcomed.
If I mark the test SeeAllData=True then, rather than creating the Custom Setting as part of the test data setup then all ok. Create a new Custom Setting as part of test data markup - Internal Server Error.
Any ideas welcomed.
Hello,
Custom Settings are "Data" and as such are not part of the test-environment as of Spring '12.
Just like every object will have no records by default.
You need to create a new custom setting with values
customsettingName__c setting = new customsettingName__c ();
setting.Name = 'Test Name'; setting.Value__c = 'Test Value';
insert setting;