Video Tutorial: Rapid Salesforce Configuraton with Eclipse and Force.com

Eclipse_video
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;

  1. Creating a Force.com Project in Eclipse
  2. Creating custom objects
  3. Adding standard objects to your project
  4. 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;

<fields>
<fullName>Sample_Checkbox__c</fullName>
<defaultValue>true</defaultValue>
<description>Description</description>
<inlineHelpText>Help Text</inlineHelpText>
<label>Sample Checkbox</label>
<type>Checkbox</type>
</fields>

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.

Enjoy!

Advertisements

Google saves me from certain death

Toronto maze I was visiting Toronto this past weekend and spent a nice sunny day touring Toronto Island. I'm having a lovely time and I see a long row of hedges with a sign near an opening. Sure enough it turns out to an entrance to a maze straight out of The Shining. I'm game, so I go in meandering through the twists, turns, and dead ends. But, after 15 minutes I'm getting bored, hot, and attacked by mockingbirds left and right. So, before I start seeing any twins and rivers of blood, I whip out my trusty blackberry and bring up Google Maps Mobile. I get a fix on my location and start following the directional arrows to freedom.