You need to sign in to do that
Don't have an account?
Rick Blake
Approval.isLocked() Invalid conversion from runtime type
I'm trying to get a list 'oppsToLock', which are opportunities from 'opps' that are not locked.
But this code is giving me a runtime error:
System.TypeException: Invalid conversion from runtime type Set<String> to Set<Id>
Approval.isLocked() is supposed to return a map of Id and true/false so why doesn't this work?
List<Id> oppsToLock = new List<Id>();
Map<Id,Boolean> mapLocks = Approval.isLocked(opps);
for(Id oppId : mapLocks.keySet()){
if(mapLocks.get(oppId)==false){
oppsToLock.add(oppId);
}
}
But this code is giving me a runtime error:
System.TypeException: Invalid conversion from runtime type Set<String> to Set<Id>
Approval.isLocked() is supposed to return a map of Id and true/false so why doesn't this work?
List<Id> oppsToLock = new List<Id>();
Map<Id,Boolean> mapLocks = Approval.isLocked(opps);
for(Id oppId : mapLocks.keySet()){
if(mapLocks.get(oppId)==false){
oppsToLock.add(oppId);
}
}