From a318f7f8ac657e655e659854fc7b62b5796e7b63 Mon Sep 17 00:00:00 2001 From: Chad Date: Fri, 10 Nov 2023 14:54:45 -0600 Subject: [PATCH] Updates method retrieving existing Faculty affiliations for contact Updates Account Id to Affiliation Map creation by preventing existing maps being cleared on new map insertions --- force-app/main/default/classes/CCON_Faculty_TDTM.cls | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/force-app/main/default/classes/CCON_Faculty_TDTM.cls b/force-app/main/default/classes/CCON_Faculty_TDTM.cls index 758301083b..e25e66a92e 100644 --- a/force-app/main/default/classes/CCON_Faculty_TDTM.cls +++ b/force-app/main/default/classes/CCON_Faculty_TDTM.cls @@ -323,7 +323,6 @@ public with sharing class CCON_Faculty_TDTM extends TDTM_Runnable { ]; Map>> contactIdAccountIdAfflList = new Map>>(); - Map> acctAffl = new Map>(); for(Affiliation__c affl : affls) { // Check if Contact ID key exists @@ -334,16 +333,14 @@ public with sharing class CCON_Faculty_TDTM extends TDTM_Runnable { contactIdAccountIdAfflList.get(affl.Contact__c).get(affl.Account__c).add(affl); } else { // Create empty map and add Account ID to Affiliation Map - acctAffl.clear(); - acctAffl.put(affl.Account__c, new List{affl}); + Map> acctAffl = new Map>{ affl.hed__Account__c => new List{affl} }; contactIdAccountIdAfflList.get(affl.Contact__c).putAll(acctAffl); } } else { - acctAffl.clear(); - acctAffl.put(affl.Account__c, new List{affl}); + Map> acctAffl = new Map>{ affl.hed__Account__c => new List{affl} }; contactIdAccountIdAfflList.put(affl.Contact__c, acctAffl); } } return contactIdAccountIdAfflList; } -} \ No newline at end of file +}