This feature is to make your sandbox environment business ready, automate data manipulation or business logic tasks or even to schedule your jobs.
At sandbox creation, specify a single Apex class to perform the tasks. This class executes every time the sandbox is refreshed/copied.

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. You can include your scheduled jobs code also inside the method.
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.
Hi,
Now that this feature is GA, do you have information on what this class can do? What are its limits?
Release notes has very small information on this.
Thanks, Manju
LikeLike
Hi Manju. Salesforce hasn’t mentioned any limitations on this too. So, I’m sure it can do the basic stuff at least like:
– Object data insertions (which is the most important feature here, to have some data in our sandboxes immediately after refresh).
– Any static constants records
– Configure scheduled apex jobs
Will keep you posted if I hear of any specific limitations.
LikeLiked by 1 person