I just created an Apex Trigger on the Apex object. The trigger works great in salesforce classic but does not work in the new lightning experience. Any guidance would be fantastic please ??? Here is my code :
Trigger taskbeforeInsert on Task (before insert) {
set<id> ctcids= new set<id> ();
for(task t: trigger.new){
ctcids.add(t.WhoId );
}
Map<ID, contact> m = new Map<ID, contact>([ select accountID ,id from contact where id in :ctcids ]);
for(task t: trigger.new){
if( t.WhoId!= null){
if (m.containsKey(t.WhoId)) {
t.whatID = m.get(t.WhoId).accountID ;
}
}
}
}