function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LiamCoLiamCo 

Custom Settings method return wrong values when called from build.xml file in Winter 13

Hi,

 

We're using the the Force.com migration tool to deploy code into our integration and test instances using ant and as part of the deployment we run the unit tests which have just started failing since we moved to Winter 13.

 

I've narrowed the problem down to calls to the getInstance method on custom settings objects. The problem only manifests itself when the tests are run from the build.xml file, if I run the code directly from the site it works fine, even though I am logged on as the same user in each case.

 

If I call

 

Connect_Category_Scale__c.getInstance('100');

 

it returns null but if I call

 

Map<string, Connect_Category_Scale__c> allCCS = Connect_Category_Scale__c.getAll();

allCCS.get('100');

 

the expected value is returned.

 

I have installed the latest version of the migration tool from our site.

 

Does anyone have any ideas as to why this is happening ?

 

Thanks,

 

Liam

 

crop1645crop1645

LiamCo -- aha, someone else has found this same issue!  See http://boards.developerforce.com/t5/Apex-Code-Development/Winter-13-anomaly-Test-runs-using-Force-com-Run-Tests-UI-but/m-p/499331/highlight/true#M92363

 

I have an open case with SFDC; see the workaround in the post

kibitzerkibitzer

It looks like this impacts package installations as well.

kibitzerkibitzer

It looks like the problem has been resolved. I've done further testing on a Winter 13 sandbox and the code that previously failed is now working correctly (including package installation).