• Aaron Winters 24
  • 0 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 0
I'm an administrator for two orgs (one on na2 and one on na27) and I haven't been able to get a class based on the new SandboxPostCopy interface to execute on sandbox refresh for either org. At this point I am trying to see if I can even get a simple script to execute on refresh. The class, test class and refresh steps are below. Am I missing something?

SandboxPostCopy class:
global class HelloSandbox implements SandboxPostCopy {
    global void runApexClass(SandboxContext context) {
        Account a = new Account(Name='Acme');
        insert a;        
This code executes fine with Execute Anonymous.

This is the test class:
class HelloSandboxTest{

  static void testSandboxPostCopyScript() {
    HelloSandbox apexclass = new HelloSandbox();
    Test.testSandboxPostCopyScript(apexclass, UserInfo.getOrganizationId(), UserInfo.getOrganizationId(), 'dev');
    System.assertEquals(1,1,'Test something');
Where the development sandbox is named "dev". This covers 100% of code in the related class.

This is what I enter in the Create Sandbox step of the refresh process:
User-added image
Thanks very much in advance!