+ Start a Discussion

How to query AsyncResult/DeployResult records?

I was thinking to create a mechanism which will give information about the deployment statuses using Metadata API. But I stuck at the point where I am not able to query records related to AsyncResult/DeployResult. I don't know whether it is possible or not.
Any suggestions would be really helpful for me. Thanks!
NagendraNagendra (Salesforce Developers) 
Hi Gaurav,

If you investigate the Id value you will see that the object type is DeployRequest:
system.debug(Id.valueOf('0Af'.rightPad(15, '0')).getSObjectType());
This object is not currently available for query in SOQL, nor via the Tooling API or Metadata API.

But there is an API call: checkDeployStatus. This returns a DeployResult object that includes things like start date/time, end date/time, status, who canceled it, number of tests run, errors, and so on.

Please let us know if this helps.

Kindly mark this as solved if the reply was helpful.

Thanks, Nagendra, for your response.
The link you shared with me which tells about checkDeployStatus which requires an Id to be passed to get the status of that specific deployment. But, here I am looking to get all the records or at-least all Ids from DeployResult object to external environment and then I would use different to get the status.
Naika ChanduNaika Chandu
Hi GauravTrivedi,

Have you got any solution even I am having similar requirement.
Hey Naika,
No, I didn’t get the solution for this.
Edvan SousaEdvan Sousa

Any update regarding it??  I´m try create an solution like this :/