You need to sign in to do that
Don't have an account?
Saumya Suman
Hii, help me to write this code
Write an Apex code to find the number of tasks Assigned to a Particular contact related to an Opportunity record.
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
map<string,string> contactOppMap;
// extract contact id and store with opportunity i n a map for refernce
for( Opportunityt this : [ select id , contactid from Opportunity]){
map<string,integer> contactTaskMap;
// now loop over the contacts and put the size of the tasks in another map
for( COntact con : [ select id ,( select id from tasks) from contact where ide in : contactOppMap.keySet() ]){
contactTaskMap.put(con.id,con.tasks==null?0:con.tasks.size()) ;
}
// now link the two maps and yer good to go.