/*Method for updating Lead Rating Count on Custom Object names 'Configration'*/
- public void leadRatingCount(Map<id,Lead> triggerNewMap)
- {
- Map<String,Integer> objMap=new Map<String,Integer>{'Hot'=>0,'Warm'=>0,'Cold'=>0};
- for(Lead objLead:triggerNewMap.Values())
- {
- objMap.put(objLead.rating,objMap.get(objLead.Rating)+1);
- }
- Configration__c objConfigration=[select Hot_Leads__c,Warm_Leads__c,Cold_Leads__c from Configration__c limit 1];
- System.Debug('Hot value '+objConfigration.Hot_Leads__c+'plus'+objmap.get('Hot'));
- objConfigration.Hot_Leads__c +=objmap.get('Hot');
- objConfigration.Warm_Leads__c +=objmap.get('Warm');
- objConfigration.Cold_Leads__c +=objmap.get('Cold');
- update objConfigration;
- }
No comments:
Post a Comment