0

I'm developing an app that uses APEX + SOAP API to retrieve and deploy metadata (specifically - objects). I'm using apex-mdapi to get it done with SOAP. I want to retrieve deployment's details when it fails.

I'm using checkDeployStatus method to check if deployment is done and to get it's status:

    @AuraEnabled
    public static void checkDeployAsyncRequest(String asyncResultId){
        MetadataService.MetadataPort service = createService();
        MetadataService.DeployResult deployResult = service.checkDeployStatus(asyncResultId, true);

        System.debug(deployResult.Id);
        System.debug(deployResult.errorMessage);
        System.debug(deployResult.errorStatusCode);
    }

errorMessage and errorStatusCode are null:

enter image description here

Anyway I can get the details in Setup and using Rest API as well:

enter image description here enter image description here

How can I achieve this using SOAP?

1 Answer 1

1

The error message should be in:

System.debug(deployResult.details.componentFailures[0].problem);

The topLevel errorMessage and errorStatusCode are for payload problems (e.g. invalid XML or a missing file). Once it starts processing, you need to check componentFailures for error messages.

1
  • Why didn't I think of the fact that the soap result might have the same structure as the rest? I have no idea! Thanks, @sfdcfox :) Jun 15 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.