| | |
| | | if (Trigger.isUpdate) { |
| | | old = Trigger.oldMap.get(local.Id); |
| | | } |
| | | |
| | | //20230303 lt DB202302421915 start |
| | | if(Trigger.isBefore && Trigger.isUpdate && local.Pregnant_Rest__c != old.Pregnant_Rest__c){ |
| | | if(old.Pregnant_Rest__c == FALSE && local.Pregnant_Rest__c == TRUE){ |
| | | local.Maternity_leave_StartDate__c = Date.today(); |
| | | } |
| | | if(old.Pregnant_Rest__c == TRUE && local.Pregnant_Rest__c == FALSE){ |
| | | local.Maternity_leave_EndDate__c = Date.today(); |
| | | } |
| | | } |
| | | //20230303 lt DB202302421915 end |
| | | |
| | | if (String.isNotBlank(local.Employee_No__c) |
| | | && ( Trigger.isInsert |
| | | || old.Test_staff__c != local.Test_staff__c |