Trigger to update the Date field one day less than to next year

Trigger to update the Date field one day less than to next year

Sample Code:

trigger dateUpdate on Pincode__c (before insert, before update)
{
    for(Pincode__c p : trigger.New)
    {
        p.X1st_Anniversary__c = p.Evaluation_Date__c.addDays(364);
        p.X6th_Anniversary__c = p.Evaluation_Date__c.addDays(2184);
    }
}




Cheers!!!

Leave a Reply