function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kathleen Elisabeth SmithKathleen Elisabeth Smith 

Create Field that Updates Automatically Each Time an Account is Merged

I'm currently having an issue with a trigger for a scheduled process on our Opportunity object. The trigger fires both before and after any updates to an opportunity, which causes a scheduled job to run and change the account type of the parent account 2 weeks later. 
Ex. I create opportunity on 8/5/21 with the status as "In-Progress" and nothing happens with the opp. This starts our opportunity trigger. On 8/19/21, two weeks later, the scheduled job runs, finds my opportunity that hasn't been modified since 8/5, and changes the account type. 
 
Recently, I noticed that merged accounts were triggering this process, as the opportunity in the accounts being re-parented count as updated, thus firing the Opportunity trigger on the day of the account merge. This is causing some accounts (leads or inactive clients) to revert to incorrect account types, which we need to avoid. 
 
I was thinking of creating a field that would be automatically updated each time an account is merged, which I can then use in the scheduler as an exclusion, however, I am having trouble executing this. Setting the field manually is a last case scenario, as we have different users merging accounts. Does anyone have any ideas on how I can create a field (checkbox/text/picklist/etc.) on the Account object that updates if merged with another account?