You need to sign in to do that
Don't have an account?
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.
All Answers
having exact same problems with a developer sandbox.
Works fine in production, failing in sandbox...
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.
I am also on tapp0/(cs0) receiving this error - maybe we're guinea pigs?
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.
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?
Hopefully. I contacted SFDC support and they were unaware of this issue.
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.
This is still failing for me.