How to validate a package xml using Metadata API? Similar to what we do with changesets. First we validate, then we deploy. If I need to validate a list of apex classes and vf pages, how can I do so using metadata API?


If you're using ANT, you need to set checkOnly=true in your build.xml file.

If you're using the sfdx tool with mdapi:deploy, you can pass the --checkonly flag:


If you're calling the Metadata API yourself, the DeployOptions on your deploy() call need to have checkOnly set to true:


  • Yes, I was working with metadata APIs and the checkOnly = true works. Thanks! – Nilesh Mangalhara Mar 7 '18 at 10:31

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.