Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Class LeadTriggerHandler extends triggerHandler{
- public override void beforeInsert(){
- /***create list of leads with sales record type to pass to reachforce and demandbase code***/
- List<Lead> appendLds = new List<Lead>();
- for(Lead ld : (List<Lead>)trigger.new){
- if(ld.recordTypeId == '01280000000LuJ6'){
- appendLds.add(ld);
- }
- }
- //pass sales leads to reachforce/demandbase classes for data appending
- ReachforceIndustry.entry(appendLds);
- DepartmentFormula.entry(appendLds);
- DepartmenttoPersona.entry(appendLds);
- /***end of reachforce/demandbase code***/
- //check to see if lead has a personal domain
- isDomainPersonal.checkLeadDomain();
- /*****Methods for handling reassignment*****/
- //instantiate new lead assignment class
- assignLeads assignment = new assignLeads();
- //call class to take full state names and translate them into two letter state abbreviations
- abbreviateLeadState.abbreviateState();
- //call method to relate leads to any accounts meeting a certain criteria, assinging lead to account owner when when owner is active sales role,
- assignment.assignRelatedAccount();
- //call method to handle territory based queue assignment for all leads that did not find a new owner during account matching
- assignment.territoryQueueAssignment();
- //now we round robin all those leads from queues to their rightful owners
- roundRobinAssignment.roundRobinLeads();
- /*****End of Methods for reassignment*****/
- }//end of beforeInsert()
- public override void beforeUpdate(){
- //instantiate new lead assignment class
- assignLeads assignment = new assignLeads();
- //call method to handle territory based queue assignment
- //code to determine which leads to reassign is in the method
- assignment.territoryQueueAssignment();
- //round robin leads from queues to rightful owners
- roundRobinAssignment.roundRobinLeads();
- }//end of beforeUpdate()
- }//end of trigger
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement