Skip to content

Commit

Permalink
Merge 0d0ac57 into feature/256__addTestForCsvImportFix
Browse files Browse the repository at this point in the history
  • Loading branch information
salesforce-org-metaci[bot] authored Dec 17, 2024
2 parents e731cbd + 0d0ac57 commit 14ac9b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions force-app/tdtm/classes/TDTM_ObjectDataGateway.cls
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,18 @@ public without sharing class TDTM_ObjectDataGateway implements TDTM_iTableDataGa
**/
public static List<SObject> getClassesToCallForObject(String objectName, TDTM_Runnable.Action action) {
String strAction = action.Name();
String currUserName = UserInfo.getUserName();
String currUserName;
try{
currUserName = UserInfo.getUserName();
}catch(Exception e){
currUserName = null;
}
List<SObject> listClasses = new List<Sobject>();
for (Trigger_Handler__c th : listTH) {
Set<String> excludedUserNames = (th.Usernames_to_Exclude__c != null ?
new Set<String>(th.Usernames_to_Exclude__c.toLowerCase().split(';')) : new Set<String>());
if (th.Object__c == objectName && th.Trigger_Action__c != null && th.Trigger_Action__c.contains(strAction) && th.Active__c == true
&& !excludedUserNames.contains(currUserName.toLowerCase())) {
&& (currUserName != null && !excludedUserNames.contains(currUserName.toLowerCase()))) {
listClasses.add(th);
}
}
Expand Down

0 comments on commit 14ac9b5

Please sign in to comment.