Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. Task t = [Select Id, Subject, WhoId, WhatId From Task where Id =: myId];
  2. Contact c;
  3. Lead l;
  4. if(t.What.Type == 'Contact'){
  5. c = [Select Id, Name , Email From Contact Where Id =: t.WhatId];
  6. }else{
  7. l = [Select Id, Name , Email From Lead Where Id =: t.WhatId];
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement