• Mohit Sharma
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi,

I created a class in my PROD environment that implements SandboxPostCopy. My undersating is that when I create/refresh a sandbox and specify my class, the code in that class will be executed upon creating/refreshing the sandbox.

Here is the code I am using for the SandboxPostCopy class.
global class SandboxRefreshCutover implements SandboxPostCopy {

    global void runApexClass(SandboxContext context) {

        System.debug('Sandbox copy done. ' + context.organizationId() + ' ' + context.sandboxId() + context.sandboxName());
        
        //Replace the URL endpoint in a Customer Setting
        Integration_Endpoints__c integrationEndpoint = Integration_Endpoints__c.getValues('TEST');
        if(integrationEndpoint != null)
        {
            integrationEndpoint.URL__c = 'http://www.test.com';
            update integrationEndpoint;
        }
        else
        {
            integrationEndpoint = new Integration_Endpoints__c(Name = 'TEST', URL__c = 'http://www.test.com');
            insert integrationEndpoint;
        }
    }
}

Now, I tried to create a few developer sandboxes and everytime the code is not executed.
Am I missing something?

Thanks a lot in advance.
Etienne

I have to work in Metadata API to customize my salesforce org through Apex.

 

I have generated WSDL for Metadata API as well as Enterprise

but when I am generating apex code for these WSDL it is showing errors to both the files

1. Enterprise WSDL - Apex Generation FailedUnsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType

2. MetaData API- "Apex Generation Failed Class name 'Metadata' already in use. Please edit WSDL to remove repeated names"  

 

For Enterprise error changing anyType to string couldn't solve my error.

 

Please assist me if any one have any idea to get rid of this issue.

 

Thanks in advance.

 

Regards,

Tushar Seth