From 7fb99d0f7ee538022e03ba7903e6ed97fbaa849b Mon Sep 17 00:00:00 2001 From: 李彤 <litong@prec-tech.com> Date: 星期四, 16 三月 2023 10:06:17 +0800 Subject: [PATCH] 产假 --- force-app/main/default/triggers/UserToContact.trigger | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/force-app/main/default/triggers/UserToContact.trigger b/force-app/main/default/triggers/UserToContact.trigger index fafa3d9..5dea882 100644 --- a/force-app/main/default/triggers/UserToContact.trigger +++ b/force-app/main/default/triggers/UserToContact.trigger @@ -12,6 +12,18 @@ 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 -- Gitblit v1.9.1