Advertisement
Guest User

new lead trigger handler

a guest
Oct 16th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 2.17 KB | None | 0 0
  1. public Class LeadTriggerHandler extends triggerHandler{
  2.    
  3.     public override void beforeInsert(){
  4.        
  5.         /***create list of leads with sales record type to pass to reachforce and demandbase code***/
  6.         List<Lead> appendLds = new List<Lead>();
  7.         for(Lead ld : (List<Lead>)trigger.new){
  8.             if(ld.recordTypeId == '01280000000LuJ6'){
  9.                 appendLds.add(ld);
  10.             }
  11.         }
  12.         //pass sales leads to reachforce/demandbase classes for data appending
  13.         ReachforceIndustry.entry(appendLds);
  14.         DepartmentFormula.entry(appendLds);
  15.         DepartmenttoPersona.entry(appendLds);
  16.         /***end of reachforce/demandbase code***/
  17.        
  18.         //check to see if lead has a personal domain
  19.         isDomainPersonal.checkLeadDomain();
  20.        
  21.         /*****Methods for handling reassignment*****/
  22.         //instantiate new lead assignment class
  23.         assignLeads assignment = new assignLeads();
  24.         //call class to take full state names and translate them into two letter state abbreviations
  25.         abbreviateLeadState.abbreviateState();
  26.         //call method to relate leads to any accounts meeting a certain criteria, assinging lead to account owner when when owner is active sales role,
  27.         assignment.assignRelatedAccount();
  28.         //call method to handle territory based queue assignment for all leads that did not find a new owner during account matching
  29.         assignment.territoryQueueAssignment();
  30.         //now we round robin all those leads from queues to their rightful owners
  31.         roundRobinAssignment.roundRobinLeads();
  32.         /*****End of Methods for reassignment*****/
  33.        
  34.        
  35.     }//end of beforeInsert()
  36.    
  37.     public override void beforeUpdate(){
  38.         //instantiate new lead assignment class
  39.         assignLeads assignment = new assignLeads();
  40.         //call method to handle territory based queue assignment
  41.         //code to determine which leads to reassign is in the method
  42.         assignment.territoryQueueAssignment();
  43.         //round robin leads from queues to rightful owners
  44.         roundRobinAssignment.roundRobinLeads();
  45.     }//end of beforeUpdate()
  46.    
  47. }//end of trigger
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement