function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kondal Rao learnerKondal Rao learner 

Hi Regarding lead duration

HI Experts,


Actually my requirment is that when lead is created with the startdate and endate right so i will assign this lead to some other one so when owner changes of lead so i want to find the days , between this time slot i mean between first owner of lead to second owner of the lead so please guide me how to do that.




Thans in advance







Hi Adithya,


You can achieve this using a trigger here i'm posting a sample code which will help you



trigger ownerchange on Lead (before update) {

          Lead oldLead=Trigger.oldmap.get(;
             integer numberofDaysDue =  Le.DOB__c.daysBetween(Le.doj__c);   ////////// You can replace these fields with which you want to know the difference say( Le.Stastdate__c.daysBetween(Dt))
             System.Debug('@@@@'+numberOfDaysDue );




Please accept it as solution if it sloves your requirement