Created
January 17, 2024 07:49
-
-
Save TheShubhamVsnv/e656583510780095864a8f6eb40828f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Apex Class with Static Set of IDs | |
public class TriggerHandler { | |
private static Set<Id> processedRecords = new Set<Id>(); | |
public static void onBeforeUpdate(List<Account> newAccounts) { | |
for (Account acc : newAccounts) { | |
if (!processedRecords.contains(acc.Id)) { | |
// Your logic here | |
acc.Name = 'Updated Name'; | |
// Continue with your processing | |
// Add the record ID to the set to track processed records | |
processedRecords.add(acc.Id); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment