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
padmini sspadmini ss 

Trigger Before Update

Hi I have One Problem
I wrote one trigger on Before Update.
trigger toupdateDiffDatelaps on Lead (before update) {

    if(Trigger.isBefore){

         system.debug('Its in Before Update ');

        for(lead d:[Select id,Lead_Convertion_Time__c,lap1_mdifieddate__c,IsConverted,LastViewedDate,IsUnreadByOwner from Lead where id in:trigger.newmap.keyset()]){
        if(d.IsConverted!=TRUE){
                  system.debug('Is Going to Convert ');
                   string timeduration;
                   if(d.lap1_mdifieddate__c!=null)
                          timeduration=time_calculation.duration_between_two_date_times(d.lap1_mdifieddate__c,datetime.now() );
                    else
                          timeduration='kkk';
                  system.debug('time lap is :'+timeduration);
                  d.Lead_Convertion_Time__c=timeduration;
                 system.debug('d.Lead_Convertion_Time__c '+d.Lead_Convertion_Time__c);
}
}
}


In Debug Log Its Showing the Time Stamp as :
 

d.Lead_Convertion_Time__c 2 Minutes 20 Seconds
But i am unable to REplicate this in the Vf page ,... Can any one telll me where am Overlooking please,,..!!
MithunPMithunP
Hi Padmini,

What is your issue, can you explain in detail.

Best Regards,
Mithun.