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
Rick BlakeRick 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);
    }
}