+ Start a Discussion
balaji_SFDCbalaji_SFDC 

Start the number count when status is changed

Hi Experts,

I have one field in lead numberoflocations.this field will increment by 1 when task status is completed.But when status is changed from closed to open numberoflocations set to zero and after that when creating tasks and status is completed then onlu new tasks are counted.

Please help me how can i achieve this.Thanks in advance.
Mikola SenykMikola Senyk
You have to check field update rules that related to Lead object and NumberofLocations__c field. It looks like there is a rule that set NumberofLocations__c= 0 in case where Status is setting to 'Open'.
Of course, the same result could be achived with trigger. Therefore, look at logic of Lead triggers.
balaji_SFDCbalaji_SFDC
Hi Mikola Senyk,

Actually i have one trigger for counting when task status is completed this count appeared in numberoflocations.the trigger is working as excepted.I want one change when the lead status is changed from 'open-not contacted' to 'closed-converted' the count is reset to zero and at the same time after converting status the new tasks only count.

Hope this is understandable

Thanks,
Balaji
Mikola SenykMikola Senyk
Please, provide code of the trigger. It will help to find correct solution.