From 928399eceec50e3d37ea08669a12789a9410a9d2 Mon Sep 17 00:00:00 2001
From: 沙世明 <shashiming@prec-tech.com>
Date: 星期二, 22 十一月 2022 16:51:16 +0800
Subject: [PATCH] 111
---
force-app/main/default/triggers/AttachmentTrigger.trigger | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/triggers/AttachmentTrigger.trigger b/force-app/main/default/triggers/AttachmentTrigger.trigger
index caec12f..0ea8bd8 100644
--- a/force-app/main/default/triggers/AttachmentTrigger.trigger
+++ b/force-app/main/default/triggers/AttachmentTrigger.trigger
@@ -5,6 +5,9 @@
List<String> attdelIds = new List<String>();
List<String> rentalApplyIds = new List<String>();
List<String> accIds = new List<String>();
+ //20221014 yc 鍖婚櫌瀹℃壒浼樺寲 start
+ List<String> accAppIds = new List<String>();
+ //20221014 yc 鍖婚櫌瀹℃壒浼樺寲 end
// LHJ CHAN-BCLD4P 20190618 Start
List<String> specIds = new List<String>();
List<String> specDelIds = new List<String>();
@@ -52,6 +55,11 @@
if (String.valueOf(att.ParentId).startsWith('001')) {
accIds.add(att.ParentId);
}
+ //20221014 yc 鍖婚櫌瀹℃壒浼樺寲 start
+ if (String.valueOf(att.ParentId).startsWith('a5C')) {
+ accAppIds.add(att.ParentId);
+ }
+ //20221014 yc 鍖婚櫌瀹℃壒浼樺寲 end
if(String.valueOf(att.ParentId).startsWith(System.Label.Oppor_sepKey)){
OpporFileIds.add(att.ParentId);
}
@@ -106,6 +114,11 @@
specIds.add(att.ParentId);
}
// LHJ CHAN-BCLD4P 20190618 End
+ //20221014 yc 鍖婚櫌瀹℃壒浼樺寲 start
+ if (String.valueOf(att.ParentId).startsWith('a5C')) {
+ accAppIds.add(att.ParentId);
+ }
+ //20221014 yc 鍖婚櫌瀹℃壒浼樺寲 end
}
}
@@ -153,6 +166,22 @@
}
if (updAccList.size() > 0) update updAccList;
}
+ //20221014 yc 鍖婚櫌瀹℃壒浼樺寲 start
+ if (accAppIds.size() > 0) {
+ Map<String, String> attMap = new Map<String, String>();
+ List<Attachment> attList = [select Id, ParentId from Attachment where ParentId = :accAppIds order by ParentId];
+ for (Attachment att : attList) {
+ attMap.put(att.ParentId, att.ParentId);
+ }
+ List<Account_Delay_Apply__c> updAccAppList = new List<Account_Delay_Apply__c>();
+ for (String accappid : accAppIds) {
+ Account_Delay_Apply__c accapp = new Account_Delay_Apply__c(Id = accappid);
+ accapp.Is_upload_file__c = attMap.containsKey(accappid);
+ updAccAppList.add(accapp);
+ }
+ if (updAccAppList.size() > 0) update updAccAppList;
+ }
+ //20221014 yc 鍖婚櫌瀹℃壒浼樺寲 end
// LHJ CHAN-BCLD4P 20190618 Start
if (specIds.size() > 0) {
--
Gitblit v1.9.1