From 6947068a02499b9d1022f9efca5bcf1bdd3f1c70 Mon Sep 17 00:00:00 2001
From: Denny Chen <chenbangcai@prec-tech.com>
Date: 星期一, 28 二月 2022 10:45:11 +0800
Subject: [PATCH] Note test
---
force-app/main/default/classes/ContactTriggerHandler.cls | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/classes/ContactTriggerHandler.cls b/force-app/main/default/classes/ContactTriggerHandler.cls
index a438297..ad4e5ce 100644
--- a/force-app/main/default/classes/ContactTriggerHandler.cls
+++ b/force-app/main/default/classes/ContactTriggerHandler.cls
@@ -20,12 +20,16 @@
syncToAgencyContact();
updateDealerNum();
sendToComPlat();
+ //NFM702
+ // NFM702_Handler(this.newList , this.newMap , this.oldList , this.oldMap);
}
protected override void afterUpdate() {
syncToAgencyContact();
updateDealerNum();
sendToComPlat();
+ //NFM702
+ // NFM702_Handler(this.newList , this.newMap , this.oldList , this.oldMap);
}
protected override void beforeUpdate() {
@@ -376,4 +380,40 @@
}
+
+ public void NFM702_Handler(List<Contact> newList, Map<Id, Contact> newMap, List<Contact> oldList, Map<Id, Contact> oldMap){
+ List<Contact> conIdList = new List<Contact>();
+ List<String> idList = new List<String>();
+ String LOG_TYPE = 'NFM702';
+ // iflog.Log__c = '---------';
+ String ConTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId();
+ if (Trigger.isUpdate && Trigger.isAfter) {
+ if (newList.size() > 0) {
+ for (Contact con : newList) {
+ Contact oldCon = oldMap.get(con.Id);
+ if ((con.RecordTypeId.equals(ConTypeId)) && (con.FullName__c != oldCon.FullName__c || con.Phone != oldCon.Phone || con.Department__c != oldCon.Department__c || con.Isactive__c != oldCon.Isactive__c)) {
+ idList.add(con.Id);
+ }
+ }
+ }
+ }
+ if(Trigger.isInsert && Trigger.isAfter){
+ if (newList.size() > 0) {
+ for (Contact con : newList) {
+ if(con.RecordTypeId.equals(ConTypeId)){
+ idList.add(con.Id);
+ }
+ }
+ }
+ }
+ if (idList.size() > 0) {
+ BatchIF_Log__c iflog = new BatchIF_Log__c();
+ iflog.Log__c = '瑙﹀彂鎴愬姛';
+ iflog.Type__c = LOG_TYPE;
+ insert iflog;
+ NFM702Controller.callout(iflog.Id, idList);
+ }
+
+ }
+
}
\ No newline at end of file
--
Gitblit v1.9.1