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
pconpcon 

Problem with "casting" String to Ids

Last night, we started having tests fail in our dev environment.  We have the following methods (shortened)

 



public static void updateTargetDate(...) {
     Set<Id> futureIds = new Set<Id>();
     ...
     // Add Ids
     ...
     if (!futureIds.isEmpty()) {
          updateTargetDateFromMilestone(futureIds);
     }
}

@future
public static void updateTargetDateFromMilestone(Set<Id> caseIds) {
     ...
}

 

Yesterday at noon (we run all tests in dev at noon and midnight) all the tests were running without error.  At midnight most of our tests were failing with the following error:

 

System.TypeException: Invalid conversion from runtime type SET<String> to SET<Id>

 

with a referral to the method of updateTargetDateFromMilestone(Set<Id> caseIds).  This file has not been updated since June 24th 2011.

 

So the question is, has anyone else seen this error crop up?  I know that in Apex Strings and Id "should" be interchangeable, however, it doesn't matter in this case since the Set being made is of type Id and the Set parameter for the calling method is of type Id.

Best Answer chosen by pcon
pconpcon
It appears that this was a serverside issue that Salesforce patched and fixed on 2011-10-04

All Answers

car ramrod.ax1126car ramrod.ax1126

having exact same problems with a developer sandbox.

 

Works fine in production, failing in sandbox...

pconpcon

I've narrowed it down (for us) to a problem on tapp0(cs0).  Our QA sandbox (cs3) does not fail and one of our other developer sandboxes (cs9) does not fail either.

car ramrod.ax1126car ramrod.ax1126

I am also on tapp0/(cs0) receiving this error - maybe we're guinea pigs?

Sandeep001Sandeep001

Salesforce.com runs their patches every Wednesday or Thirsday night and it could be a result of that. Check the API version of your apex classes.

Please log a bug in Salesforce.com support.

DevNVDevNV

I'm having this as well, also on CS0 sandbox.  There is a maintenance window today from 7-8pm - maybe this will be addressed tonight?

pconpcon

Hopefully.  I contacted SFDC support and they were unaware of this issue.

BrianWKBrianWK

They may have fixed it.

 

Running a test in sandbox (tapp0) no longer gave me that error. Of course this was a sample size of 1 so we'll see. Passing it over to internal QA to confirm.

pconpcon

This is still failing for me.

pconpcon
It appears that this was a serverside issue that Salesforce patched and fixed on 2011-10-04
This was selected as the best answer