You need to sign in to do that
Don't have an account?
Deploy Metadata using Deploy() method in apex
Hi Community,
I have been working on the functionality to deploy metadata to salesforce using deploy call.
This is my code:
MetadataService.MetadataPort service = new MetadataService.MetadataPort();
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
MetadataService.DeployOptions deployOptions = new MetadataService.DeployOptions();
deployOptions.allowMissingFiles = false;
deployOptions.autoUpdatePackage = false;
deployOptions.checkOnly = false;
deployOptions.ignoreWarnings = false;
deployOptions.performRetrieve = false;
deployOptions.purgeOnDelete = false;
deployOptions.rollbackOnError = false;
deployOptions.singlePackage = true;
deployOptions.testLevel = 'NoTestRun';
MetadataService.AsyncResult result = service.deploy(zipFileContent, deployOptions);
after getting response it gives me error 'No package.XML found'
I have checked that My zip file contains package.xml for successfull deployment.
But I'm encountering error for this.
Kindly suggest me any approach or any solution to troubleshoot this issue. I need to do it urgent.
Thanks
Nikhil Garg
You can check below examples to Retrieve and Deploy Metadata through Apex.
https://sudipta-deb.in/2017/04/summer17-retrieve-and-deploy-metadata-through-apex.html
https://salesforce.stackexchange.com/questions/172155/deploying-metadata-through-metadata-operations-enqueuedeployment-fails-with-a-nu
Please mark as Best Answer if above information was helpful.
Thanks,
Thanks for your reply to my question, but the issue is related to deploy call of metadata or any other configuration.
if possible please provide any other solution to deploy the whole metadata and kindly give the structure of the package.xml file so that this can resolve.
Thanks