Stat Tracker

Tuesday, February 7, 2012

Fun Times with the Metadata API

So this past weekend I spent a few hours playing around with the Metadata API. Currently is running a developer contest to drive folks to do some cool stuff with it. In my everyday adventures, this is not a feature I get to play with alot. Typically I use the IDE to do small deploys, or the Migration Toolkit to run more complex deployments (both of which use this API under the hood).

However, there are some cool things you can do with the API. You can retrieve and update all your objects, apex code, triggers, visualforce, static resources, etc via the API. Meaning you can build tools that make deployments easy. You could even build an application to take snapshots of all your Metadata on a Nightly Basis for backing up and creating versions of objects. There are all sorts of cool stuff you can do!

For example, my simple java application reads a local MySQL database schema information and uploads it to Here's a screenshot of the beta or work in progress if you will:

You can also take a look at this demo on YouTube here:

Hopefully I'll get this sucker finished up soon. Once I do I'll post the code to GitHub along with a follow up article about it about the technical details. But if you're reading this, your probably interested in the API and what you can do. And really the sky's the limit!

I'd like to also give a shout out to Cloud Converter from Model Metrics while I'm talking about this. This application has been around a while and is available on the App Exchange, and its great for building data dictionaries for clients. Its Open Source too, so you can take a peak of the code on Google Code.