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 

Using @future annotation with the SandboxPostCopy interface

I am trying to setup a method that will be auto run when the sandbox is refreshed the problem is that it is an aync class and I am getting
'Unsupported parameter type SandboxContext' since @future methods must be static. Does anyone know of a way to setup async SandboxPostCopy  methods?

global class FixSandboxUsers implements SandboxPostCopy {
    global static void runApexClass(SandboxContext context){
Francisco Riccomagno 1Francisco Riccomagno 1
Hi, did you try removing the @future call? You should not implement that specific method to be @future. If you need something specific to be run asynchronously then implement a private method that has the @future attribute and then call it from inside the runApexClass. I did this and is working as expected.