<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Enforcer.net &#187; metadata</title>
	<atom:link href="http://theEnforcer.net/category/metadata/feed/" rel="self" type="application/rss+xml" />
	<link>http://theEnforcer.net</link>
	<description>a force.com blog</description>
	<lastBuildDate>Sat, 25 Feb 2012 04:13:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Adding multiple fields via metadata</title>
		<link>http://theEnforcer.net/2009/05/adding-multiple-fields-via-metadata/</link>
		<comments>http://theEnforcer.net/2009/05/adding-multiple-fields-via-metadata/#comments</comments>
		<pubDate>Mon, 25 May 2009 01:54:22 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Force.com IDE]]></category>
		<category><![CDATA[metadata]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=75</guid>
		<description><![CDATA[Today I had to add 32 Checkbox fields to my Contact object. I could have done this by manually creating each field, but the thought of clicking through over 100 screens didn&#8217;t take my fancy. So, I thought I&#8217;d take the Force.com Metadata API for a spin. The last time I played with Metadata, I [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to add 32 Checkbox fields to my Contact object. I could have done this by manually creating each field, but the thought of clicking through over 100 screens didn&#8217;t take my fancy. So, I thought I&#8217;d take the Force.com <strong>Metadata API</strong> for a spin.</p>
<p>The <a href="http://theenforcer.net/2008/07/meta-impressed-with-the-new-metadata-migration-tool/" target="_blank">last time</a> I played with Metadata, I did it via the command-line <a href="http://wiki.developerforce.com/index.php/Migration_Tool" target="_blank">Metadata Migration Tool</a> . This time I decided to do it via the IDE.</p>
<p>Fortunately, there&#8217;s plenty of information available on this topic, the best of which are:</p>
<ul>
<li>Eric Santiago&#8217;s <a href="http://www.ericsantiago.com/eric_santiago/2008/06/rapid-salesforce-configuraton-with-eclipse-and-forcecom.html" target="_blank">Video Tutorial: Rapid Salesforce Configuraton with Eclipse and Force.com</a> that even includes a video with step-by-step instructions. Details on adding custom fields starts around 15 minutes into the video.</li>
<li>Jeff Douglas&#8217; blog post on <a href="http://blog.jeffdouglas.com/2008/07/15/migrating-salesforcecom-configurations-with-the-metadata-api-forcecom-migration-tool/" target="_blank">Migrating Salesforce.com Configurations with the Metadata API &amp; Force.com Migration Tool</a></li>
</ul>
<p>First I updated my Force.com IDE extensions in Eclipse (always make sure you&#8217;re working on the most recent version!). One nice feature I see they&#8217;ve added is the ability to select exactly which objects are copied down to the IDE. I simply ticked &#8216;Contacts&#8217; and it appeared in my Package Explorer.</p>
<p><img class="aligncenter" src="http://theenforcer.net/wp-content/uploads/2009/05/select.png" alt="" width="208" height="217" /></p>
<p>Then, I just did a Copy &amp; Paste job on the metadata, changing the labels for each field.</p>
<pre class="brush: jscript; title: ; notranslate">&lt;CustomObject xmlns=&quot;http://soap.sforce.com/2006/04/metadata&quot;&gt;
    &lt;fields&gt;
        &lt;fullName&gt;BI_Owns_Active_Bamboo__c&lt;/fullName&gt;
        &lt;defaultValue&gt;false&lt;/defaultValue&gt;
        &lt;label&gt;Entity Owns Active Bamboo&lt;/label&gt;
        &lt;type&gt;Checkbox&lt;/type&gt;
    &lt;/fields&gt;
    &lt;fields&gt;
        &lt;fullName&gt;BI_Owns_Active_Clover__c&lt;/fullName&gt;
        &lt;defaultValue&gt;false&lt;/defaultValue&gt;
        &lt;label&gt;Entity Owns Active Clover&lt;/label&gt;
        &lt;type&gt;Checkbox&lt;/type&gt;
    &lt;/fields&gt;
etc.</pre>
<p>I then hit Save and the fields magically appeared in Salesforce.com — I was even somewhat naughty and did it straight into my Production instance (although best practice would be to do it in the Sandbox and then copy across / deploy the change).</p>
<p><img class="aligncenter" src="http://theenforcer.net/wp-content/uploads/2009/05/owns.png" alt="" width="439" height="283" /></p>
<p>Okay, I&#8217;ve still got a bit of work to do if I want to add the Checkboxes to my Page Layout, but at least the laborious part is over — the rest is all Drag &amp; Drop!</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>The latest Force.com IDE facility lets you choose Standard Objects without having to play with <code>package.xml</code></li>
<li>Creating lots of fields can be done quickly via the IDE, rather than the normal Force.com UI</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2009/05/adding-multiple-fields-via-metadata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meta-impressed with the new Metadata Migration Tool</title>
		<link>http://theEnforcer.net/2008/07/meta-impressed-with-the-new-metadata-migration-tool/</link>
		<comments>http://theEnforcer.net/2008/07/meta-impressed-with-the-new-metadata-migration-tool/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 08:27:35 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[metadata]]></category>

		<guid isPermaLink="false">http://theenforcer.net/?p=10</guid>
		<description><![CDATA[I was coding up an Apex Trigger today and ran into a bit of a problem. I was coding on my Sandbox system (as one should), but needed to access some custom fields that I had created on the Campaign object. Unfortunately, I had created these fields in my Production system and were not available [...]]]></description>
			<content:encoded><![CDATA[<p>I was coding up an Apex Trigger today and ran into a bit of a problem. I was coding on my Sandbox system (as one should), but needed to access some custom fields that I had created on the Campaign object. Unfortunately, I had created these fields in my Production system and were not available in my Sandbox.</p>
<p>Yes, I could refresh my Sandbox, which would result in a perfect match with Production. However, that also clears out all the data and I hate having to reload Contacts and various objects just to be able to use the system productively.</p>
<p>So, I had a problem. My code was in Sandbox, my config was in Production. What to do?</p>
<p><strong>Enter the new Metadata Migration Tool!</strong> (aka Force.com Migration Tool)</p>
<p>Just out with the Summer &#8217;08 release is this new user-unfriendly, but perfectly useful tool. <strong>Unfriendly</strong> because it uses Ant scripts, with XML configuration files much like running Data Loader in batch mode. <strong>Perfectly useful</strong> because it was exactly what I needed!</p>
<p>In no time I managed to configure the system to extract my standard Campaign object and a matching Page Layout from Production, then deploy it to the Sandbox. Voila! My configuration was copied across without having to reload the whole Sandbox.</p>
<p>Some tricks I figured out:</p>
<ul>
<li>In the <code>build.properties</code> file, I changed <code>sf.username</code> to <code>sf.usernamePRD</code> and added <code>sf.usernameSandbox</code>. That way, I can refer to different environment within the <code>build.xml file</code>. Same for <code>sf.serverurl</code>.</li>
<li>Layout names are prefixed with the object name. To retrieve my Page Layout called &#8220;Webinar Layout&#8221; that&#8217;s on my Campaign object, I had to put this in my <code>package.xml</code>:</li>
</ul>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Package xmlns="http://soap.sforce.com/2006/04/metadata"&gt;
    &lt;types&gt;
        &lt;members&gt;Campaign&lt;/members&gt;
        &lt;name&gt;CustomObject&lt;/name&gt;
    &lt;/types&gt;
    &lt;types&gt;
        &lt;members&gt;Campaign-Webinar Layout&lt;/members&gt;
        &lt;name&gt;Layout&lt;/name&gt;
    &lt;/types&gt;
&lt;version&gt;11.0&lt;/version&gt;
&lt;/Package&gt;
</pre>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>The Metadata Migration Tool is very useful</li>
<li>I wish it had a better interface, or was integrated into the Eclipse development tool</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2008/07/meta-impressed-with-the-new-metadata-migration-tool/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

