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
Tanner RussellTanner Russell 

SandboxPostCopy Fixing users emails only works for certain admins

I have a very weird situation where I have code that queries admin users and fixes their email address on sandbox refresh. The issue I am having is the code works perfectly fine if I click the refresh button but if another system admin with exact same permissions clicks it the code will fail and spit out this username is already used in another org error, I have even tried using the login as option and chose a fellow admin and the code failed. Another note I refreshed the exact same sandboxes that they did while they got the error it worked for me... any advice helps we have all same permissions.