I have a Map with Date Like Key and all Event on that day as a List of values. Here the code I use to create the map:
Map<Date,List<Event>> mappaeventidate= new Map<Date,List<Event>>();
for(Event e:eventi_tutti){
if(!mappaeventidate.containsKey(e.StartDateTime.date())){
mappaeventidate.put(e.StartDateTime.date(),new List<Event>{e});
}else{
mappaeventidate.get(e.StartDateTime.date()).add(e);
}
}
Now I need to clone the map, and after to delete the map I created before. I'm trying to use deepclone but I have a error. Here my code:
Map<Date,List<Event>> mappaeventidate2 =mappaeventidate.deepClone();
and the error when I save the trigger:
Operation only applies to SObject value map types: Map<Date,List<Event>>
I need to delete the List of Events inside the Map but before I want to store them in another Map. Is it possible?