Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public class LeadUtils {
  2. @future public static void deleteJunkLeads(Id[] leadIds) {
  3. Id junkQueueId = [SELECT Id FROM Group WHERE DeveloperName = 'JunkLeadQueue' AND Type = 'Queue'].Id;
  4. delete [SELECT Id FROM Lead WHERE Id IN :leadIds AND OwnerId = :junkQueueId];
  5. }
  6. }
  7.  
  8. trigger queueDeleteJunkLeads on Lead (after insert) {
  9. LeadUtils.deleteJunkLeads(Trigger.newMap.keySet());
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement