I'm trying to find the most simple way to cast a map<Object, List<Sobject>> in any other type like, String, Integer and etc..
Anyone knows how to do this?
This is my code
Map<Object, SolicitationItem__c[]> mapHierarchyRequestToItem = (Map<Id,SolicitationItem__c[]>) Collection.of(newRecordsMap.values()).group().byField(SolicitationItem__c.HierarchySolicitation__c).get();
ERROR:
Incompatible types since an instance of Map<Object,List> is never an instance of Map<Id,List<SolicitationItem__c>> (11:72)
Collection.of()? Are you using some library? Please [edit] to add details. – David Reed Apr 25 '22 at 18:33I'd like to convert my map<Object... in any other type like string, integer
– Matheus Coelho Campos Apr 25 '22 at 18:37