I’ve used the Force.com IDE which is built on the popular Eclipse platform here and there since it was first released. Mainly to build Apex triggers and VisualForce pages in my developer org in preparation for the Summer ’08 release. I also used it to copy some custom profiles between two orgs. But recently, someone mentioned to me that I could use Eclipse to add custom fields to both custom and standard objects. (I stress the latter because for all my Googling I came across only a single post on this.) Given how frequently I’m building out fields in Salesforce, I’m painfully aware of how the standard wizards (while great for general administrators) are much to slow for developers and consultants deploying multiple fields on multiple objects for multiple instances.

Using Eclipse makes field creation a cut and paste operation. It also allows you to work offline. Those two facts alone make it worthwhile, but you can also copy objects, profiles, VisualForce pages, Apex code, and more between orgs as simply as Ctrl-C…Ctrl-V.

Unfortunately, it took me a while to figure out how to do all this. Documentation is tremendous for the Salesforce app, but lacking for the IDE. So I decided to pay it forward once again and put together a video outlining the major steps for;

Creating a Force.com Project in Eclipse

Creating custom objects

Adding standard objects to your project

Adding fields to custom and standard objects

The key discovery was the format for fields in the Metadata API. The documentation only had a single example and the Eclipse help file had none. Simply put the fields are defined by XML tags as such;

The IDE is not yet as mature as say, Dreamweaver. So while you’ll get suggestions as to what tags are available as you start typing, it isn’t smart enough yet to just paste in all the parameters needed for the type of field being inserted. This means you have to know that Picklists require a <picklistValues> tag. Or that <externalId> only applies to certain field types.

To save time, download my cut and paste cheatsheet of the custom fields and parameters you can use to cut and paste new fields in Eclipse.

You cannot write Apex code directly to a production environment. Create you code in a Sandbox or Developer org first. Then right click on the Src folder in Eclipse and select Deploy to Server. This will walk you through the steps of propagating Apex code to a production environment. Remember you will need to have written test classes that provide coverage prior to deploying. You can’t deploy code that has less than 70% test coverage.

Hello there…I’m a newbie to the metadata api and Salesforce in general. I’m just trying to explore this arena and have some basic questions (apologies in advance, if they sound too rudimentary). So, I’ve created a force.com project that’s associated to my company Sandbox environment. I selected the objects that I want to bring over to my project.(The primary purpose for this exercise was to test if I could bring some picklist configurations that I’ve made in the Sandbox org INTO our Production Org). But before that I want to deploy these configurations from Sandbox to a Developer Org that I created…(since I don’t want to do this first test on my production org). So, how do I do this? (“Deploy to Server” option?). Thanks in advance for any help/feedback!!
-SFDC newbie.