Capture Time stamp on status change

trigger captureTimeStamp on applications__c (before update) {
for(applications__c a:trigger.new){
 applications__c oldApp = Trigger.oldMap.get(a.Id);
if(a.Stage__c == 'status 2' && oldApp.Stage__c != 'status 2') {
if(a.status_2_time_stamps__c == null){
a.status_2_time_stamps__c = Date.Today();
}else{
a.status_2_time_stamps_1__c=Date.Today();
}
}
}
}

Comments

Popular Posts