I have two identical statements that I am running in execute anon and I am getting different results based on the which org I am running it against.
In my packaging org if I run the code below, I get the value in the custom setting.
String customSettingVal =rws__T2_RWS_SiteProductMap__c.getInstance(site.getName()).rws__SFDC_InsuranceProductName__c System.debug('----> '+customSettingVal);
If I run the same code as above (again from execute anon) in a subscriber org I get a null value returned.
Question is why the different behavior ? and why does it even work in the packaging org, surely site.getName() would return null anyway when run from execute anon. I have tried printing the contents of site.getName() and it is null in both orgs when in execute anon
Gotta love salesforce sometimes