Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Task t = [Select Id, Subject, WhoId, WhatId From Task where Id =: myId];
- Contact c;
- Lead l;
- if(t.What.Type == 'Contact'){
- c = [Select Id, Name , Email From Contact Where Id =: t.WhatId];
- }else{
- l = [Select Id, Name , Email From Lead Where Id =: t.WhatId];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement