You need to sign in to do that
Don't have an account?
Andrew Telford
Loop through sObject Map
I am attempting to use a frame work (http://chrisaldridge.com/triggers/lightweight-apex-trigger-framework/) and I am running in to an issue when I attempt to loop thorugh a MAP that is passed to a class.
This is the code I currently have
This is the error I get when I save the TaskTriggerHandler class
Invalid initial type Map<Id,SObject> for Map<Id,Task>
What am I missing?.
This is the code I currently have
public void AfterInsert( Map<Id, SObject> newItems ) { //– Collect the common information //———————————————————————————————————————- List<Contact> contsToUpdate = new List<Contact>(); List<Contact> updateContacts = new List<Contact>(); Set<<D> contactIDs = new Set<ID>(); List<Task> thisTask = new List<Task>(); SYSTEM.debug('Where Are We?: AfterInsert Task'); SYSTEM.debug('What type of object?: ' + newItems.getSObjectType() ); SYSTEM.debug('What is our Size: ' + newItems.size() ); SYSTEM.debug('Who?: ' + newItems.get('WhoId') ); Map<Id, Task> MyMap = new Map<Id, Task>(newItems); //– Error here thisTask.addAll(MyMap.values()); }
This is the error I get when I save the TaskTriggerHandler class
Invalid initial type Map<Id,SObject> for Map<Id,Task>
What am I missing?.
Try this one - Thanks,
Sumit Kumar Singh
Doesn't appear to be liked in the Developer Console. Still getting an error relating to Signature
Code:
Error:
Method does not exist or incorrect signature: task(SObject)
Sumit Kuamr Singh