This feature is to make your sandbox environment business ready, automate data manipulation or business logic tasks.

At sandbox creation, specify a single Apex class to perform the tasks. This class executes every time the sandbox is refreshed/copied.
Lightning interface of sandbox post-copy script specification
Create an Apex class that implements SandboxPostCopy and specify the class here. For example, the following Apex class simply reports the three contexts available in SandboxPostCopy: your organization ID, sandbox ID, and sandbox name:
global class HelloWorld implements SandboxPostCopy {
  global void runApexClass(SandboxContext context) 
  {   
      System.debug(context.organizationId());
      System.debug(context.sandboxId());
      System.debug(context.sandboxName());
   }
}
Note: This feature isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. It can’t be guaranteed general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Advertisements