<?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</title>
	<atom:link href="http://theEnforcer.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://theEnforcer.net</link>
	<description>a force.com blog</description>
	<lastBuildDate>Fri, 30 Jul 2010 07:02:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A confluence of bloggers</title>
		<link>http://theEnforcer.net/2010/07/a-confluence-of-bloggers/</link>
		<comments>http://theEnforcer.net/2010/07/a-confluence-of-bloggers/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 08:28:26 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Dreamforce]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=260</guid>
		<description><![CDATA[Fellow blogger CRMFYI tweeted this to me.
It&#8217;s a picture from the Dreamforce 2010 website showing the front-row of Dreamforce 2009, filled with Press and Bloggers.

I&#8217;m seated beside David Schach (x2od and co-author of Daily Shinro), behind Jeff Grosse (CRMFYI). I think we were busy Tweeting funny messages so they&#8217;d appear on the big screen. Or [...]]]></description>
			<content:encoded><![CDATA[<p>Fellow blogger <a href="http://crmfyi.com/">CRMFYI</a> <a href="http://twitter.com/CRMFYI/status/19792515603">tweeted</a> this to me.</p>
<p>It&#8217;s a picture from the Dreamforce 2010 website showing the front-row of Dreamforce 2009, filled with Press and Bloggers.</p>
<p><img class="aligncenter size-full wp-image-261" title="A Confluence of Bloggers" src="http://theEnforcer.net/wp-content/uploads/2010/07/BloggerConfluence-1.jpg" alt="A Confluence of Bloggers" width="707" height="638"  border=1/></p>
<p>I&#8217;m seated beside David Schach (<a href="http://www.x2od.com/blog/">x2od</a> and co-author of Daily Shinro), behind Jeff Grosse (<a href="http://crmfyi.com/">CRMFYI</a>). I think we were busy Tweeting funny messages so they&#8217;d appear on the big screen. Or playing Tetris.</p>
<p>Neat, eh! ( D447JMZZ5QT3 )</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>We&#8217;re world-famous on a web page</li>
<li>Remember to always dress well!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/07/a-confluence-of-bloggers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Off Topic: Can you recommend a Business Intelligence tool?</title>
		<link>http://theEnforcer.net/2010/07/can-you-recommend-a-business-intelligence-tool/</link>
		<comments>http://theEnforcer.net/2010/07/can-you-recommend-a-business-intelligence-tool/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 02:44:12 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Reports]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=255</guid>
		<description><![CDATA[This is a little off-topic, but I think that my audience of readers may actually know a lot about this topic!
My company is searching for a Business Intelligence (Reporting) system, and I&#8217;d love to get suggestions of systems to investigate!
Our requirements are:

Web-based reporting tool
Concurrent or &#8216;unlimited user&#8217; licensing &#8212; one of the core values of [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little off-topic, but I think that my audience of readers may actually know a lot about this topic!</p>
<p><strong>My company is searching for a Business Intelligence (Reporting) system, and I&#8217;d love to get suggestions of systems to investigate!</strong></p>
<p>Our requirements are:</p>
<ul>
<li><strong>Web-based </strong>reporting tool</li>
<li><strong>Concurrent or &#8216;unlimited user&#8217; licensing</strong> &#8212; one of the core values of our company is &#8220;Open Company, No Bullshit&#8221;, so we want to give reporting access to everyone. I don&#8217;t mind if there are tiers of users (eg only some can create reports), as long as I can give access to 200+ people.</li>
<li><strong>Give users (or at least a subset of users) the ability to play with crosstabs / Pivot Tables of data</strong>, so they can slice &amp; dice the data themselves. They should be able to select rows, columns and filters so that they can do self-service reporting.</li>
<li><strong>Give users (or at least a subset of users) the ability to create their own private reports</strong>, and the ability to publish reports to the rest of the company. There should be some form of security in place so that <strong>people can&#8217;t overwrite &#8216;official&#8217; reports</strong> (eg ones created by the IT department).</li>
<li><strong>Saas or runs under RedHat</strong> (no Microsoft technologies, please!)</li>
<li><strong>Users can access on the Mac</strong> (eg Firefox, Safari as browsers)</li>
<li>No need for ETL capabilities &#8212; we&#8217;ve done all that!</li>
<li>Our preferred database is PostgreSQL, but we could be flexible on that</li>
</ul>
<p>The system will report on data in our corporate databases, so I&#8217;m not looking for any particular Salesforce functionality.</p>
<p>Saas solutions we know about:</p>
<ul>
<li><a href="http://www.birst.com/">Birst</a></li>
<li><a href="http://www.gooddata.com/products/how-it-works/">GoodData</a></li>
<li><a href="http://reports.zoho.com/">Zoho Reports</a></li>
<li><a href="http://www.pivotlink.com/">PivotLink</a></li>
<li><a href="http://www.rightscale.com/lp/bi-stack.php">RightScale</a></li>
</ul>
<p>Non-SaaS solutions we know about:</p>
<ul>
<li><a href="http://www.microstrategy.com/freereportingsoftware/">MicroStrategy</a></li>
<li><a href="http://www.instantolap.com/">InstantOLAP</a></li>
<li>Inetsoft <a href="http://www.inetsoft.com/products/StyleIntelligence/">Style Intelligence</a></li>
<li><a href="http://www.eclipse.org/birt">BIRT</a></li>
<li><a href="http://www.pentaho.com/">Pentaho</a></li>
<li><a href="http://www.jaspersoft.com/">Jaspersoft</a></li>
<li><a href="http://www.logixml.com/products/">LogiXML</a></li>
<li><a href="http://www.dimins.com/dashboards.html">Dimensional Insight</a></li>
<li><a href="http://www.informationbuilders.com/products/webfocus/index.html">WebFOCUS</a></li>
<li>Informatica <a href="http://www.informatica.com/products_services/data_explorer/Pages/index.aspx">Data Explorer</a></li>
<li><a href="http://www.panorama.com/products/nova-view-analytics/index.html">Panorama NovaView</a></li>
<li><a href="http://www.mrc-productivity.com/">m-Power</a></li>
<li><a href="http://www.prelytis.com/en/livedashboard/features.html">Prelytis LiveDashboard</a></li>
<li><a href="http://rapid-i.com/content/view/181/190/">RapidMinder</a></li>
<li><a href="http://www.sqlpower.ca/page/wabit">SQL Power Wabit</a></li>
<li><a href="http://www.statsoft.com/products/webstatistica-knowledge-portal/">Statistica</a></li>
<li><a href="http://yellowfinbi.com/YFSite.i4?currentPage=77988">Yellowfin</a></li>
</ul>
<p>We also ruled out some vendors due to the need for a Microsoft platform:</p>
<ul>
<li><a href="http://www-01.ibm.com/software/data/cognos/products/cognos-express/">Cognos Express</a></li>
<li><a href="http://www.interactivereporting.com/industry-solutions.html">Interactive Reporting</a></li>
<li><a href="http://www.qlikview.con/">QlikView</a></li>
<li><a href="http://www.synaptris.com/products/reporting-analytics/enterprise-reporting.html">Synaptris</a></li>
<li><a href="http://www.tableausoftware.com/">Tableau</a></li>
<li>&#8230;and many others</li>
</ul>
<p>So, do you know of a kick-arse web-based BI tool that empowers users to create their own reports?</p>
<p>If so, I&#8217;d love to hear from you either via <strong>ask@theenforcer.net</strong> or as a comment on this blog. Thanks!</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>I&#8217;m looking for a kick-arse web-based reporting tool</li>
<li>We&#8217;ve looked at many and haven&#8217;t been perfectly satisfied</li>
<li>Do you know of any others?</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/07/can-you-recommend-a-business-intelligence-tool/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using WhatId to find Opportunities associated with Activities</title>
		<link>http://theEnforcer.net/2010/07/using-whatid-to-find-opportunities-associated-with-activities/</link>
		<comments>http://theEnforcer.net/2010/07/using-whatid-to-find-opportunities-associated-with-activities/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 02:56:05 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[SOQL]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=252</guid>
		<description><![CDATA[We recently reassigned a heap of Opportunities between staff members. However, the previous Opportunity Owner had open Activities on the Opportunities. The new Opportunity owners couldn&#8217;t close those Activities since they belong to somebody else.
So, they asked me to find a way to bulk-close the Activities.
This sounded simple, but was made more difficult by the [...]]]></description>
			<content:encoded><![CDATA[<p>We recently reassigned a heap of Opportunities between staff members. However, the previous Opportunity Owner had open Activities on the Opportunities. The new Opportunity owners couldn&#8217;t close those Activities since they belong to somebody else.</p>
<p>So, they asked me to find a way to bulk-close the Activities.</p>
<p>This sounded simple, but was made more difficult by the fact that Activities can link to many different object types:  Account, Opportunity, Campaign, Case or Custom Object.</p>
<p>The connection is made via WhatID, which is the ID of the associated object. It can be accessed via SOQL like this:</p>
<p><code>SELECT Id, What.Name from Task</code></p>
<p>However, not all fields are available, so you can&#8217;t <code>SELECT What.OwnerId</code>.</p>
<p>Fortunately, I found a forum post called <a href="http://community.salesforce.com/t5/General-Development/Getting-Object-type-of-WhatId-WhoId-Task-Event-fields/td-p/2928" target="_blank">Getting Object type of WhatId/WhoId Task/Event fields</a> gave me a few hints, and I came up with this code:</p>
<pre class="brush: plain;">
// Get list of Opportunities owned by new person
Opportunity[] opps = [Select Id from Opportunity where OwnerId = '005200300014jeN'];

// Get incomplete Activities owned by previous person attached to the above Opportunities
Task[] tasks = [select Id, What.Name from Task where OwnerId = '00520000000tSOj' and Status != 'Completed' and WhatId in :opps];
for (Task t : tasks) {
  t.Status = 'Completed';
}
update tasks;
</pre>
<p>This grabs a list of &#8216;owned&#8217; Opportunities and checks for any Activities (which are actually Task objects) that have a <code>WhatId</code> matching those Opportunities.</p>
<p>Straight-forward and pretty simple. Almost makes up for not being able to traverse directly to the linked object.</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>Activities can link to multiple objects</li>
<li>They connect via WhatId, but only a limited number of fields are exposed, eg What.Name</li>
<li>Use an &#8216;IN&#8217; comparison to match the Activities with Opportunities</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/07/using-whatid-to-find-opportunities-associated-with-activities/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Manually-entered Date value in Apex SOQL query</title>
		<link>http://theEnforcer.net/2010/07/manually-entered-date-value-in-apex-soql-query/</link>
		<comments>http://theEnforcer.net/2010/07/manually-entered-date-value-in-apex-soql-query/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 01:24:36 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[SOQL]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=244</guid>
		<description><![CDATA[I run into this problem all the time.
I want to write a quite routine in the System Log window to Mass Update some records (eg my previous Mass Delete via System Log window blog post). I want to find all records before a certain date, but SOQL never likes my date format, eg:
select Id from [...]]]></description>
			<content:encoded><![CDATA[<p>I run into this problem all the time.</p>
<p>I want to write a quite routine in the System Log window to Mass Update some records (eg my previous <a href="http://theEnforcer.net/2009/01/mass-delete">Mass Delete via System Log window</a> blog post). I want to find all records before a certain date, but SOQL never likes my date format, eg:</p>
<p><code>select Id from Opportunity where Expiry_Date__c &lt; <span style="color: #ff0000;">2010-01-01</span></code></p>
<p>Yes, it is possible to convert it to Timezone format and do it this way:</p>
<p><code>select Id from Opportunity where Expiry_Date__c &lt; 2008-01-01<span style="color: #ff0000;">T00:00:00Z</span></code></p>
<p>but I&#8217;ve always thought that silly when comparing against a Date field.</p>
<p>So, I eventually figured out that I can do it this way:</p>
<p><code>select Id, Name, LastLoginDate from User where LastLoginDate &gt; <span style="color: #ff0000;">:Date.valueOf('2008-01-01')</span></code></p>
<p>Of course, this only works within the context of Apex, such as the System Log window. It won&#8217;t work in pure SOQL tools like <a href="http://www.pocketsoap.com/osx/soqlx/">SOQL Explorer</a>. Here&#8217;s an example:</p>
<pre class="brush: plain;">
Opportunity[] opps = [select Id from Opportunity where Expiry_Date__c &lt; :Date.valueOf('2010-01-01')];
System.Debug(opps.size());
</pre>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>Date strings can&#8217;t be entered into SOQL</li>
<li>Option 1: Use Timezone format: 2010-01-01T00:00:00Z</li>
<li>Option 2: Convert from string: :Date.valueOf(&#8217;2010-01-01&#8242;)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/07/manually-entered-date-value-in-apex-soql-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forcing DataLoader to extract numbers when using databaseWrite</title>
		<link>http://theEnforcer.net/2010/06/forcing-dataloader-to-extract-numbers-when-using-databasewrite/</link>
		<comments>http://theEnforcer.net/2010/06/forcing-dataloader-to-extract-numbers-when-using-databasewrite/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 07:34:34 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Data Loader]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=237</guid>
		<description><![CDATA[Oh boy, I love debugging!
And today I really had to debug DataLoader!
I do a lot of stuff with DataLoader — see my previous blogs on the topic. But I&#8217;ve always uploaded to Salesforce from a PostgreSQL database — never extracted.
DataLoader allows a job to be configured where a SOQL query is run, the data is [...]]]></description>
			<content:encoded><![CDATA[<p>Oh boy, I love debugging!</p>
<p>And today I really had to debug DataLoader!</p>
<p>I do a lot of stuff with DataLoader — see my <a href="http://theenforcer.net/category/data-loader/">previous blogs on the topic</a>. But I&#8217;ve always uploaded <em>to</em> Salesforce from a PostgreSQL database — never <em>extracted</em>.</p>
<p>DataLoader allows a job to be configured where a SOQL query is run, the data is extracted from Salesforce and the results are inserted into a database. The documentation is woeful on this whole topic, but fortunately DataLoader comes with sample <code>process-conf.xml</code> and <code>database-conf.xml</code> files that contain some examples.</p>
<p>The basic method is:</p>
<ul>
<li><code>process-conf.xml</code> defines the job and includes the SOQL in a <code>extractionSOQL</code> parameter</li>
<li>An <code>SDL</code> file defines the field mapping between Salesforce and the output</li>
<li><code>database-conf.xml</code> defines the SQL statement to use, plus the parameter types</li>
</ul>
<p><strong>First hint:</strong> The Field names in the <code>SDL</code> file are case-sensitive. Use &#8220;ID&#8221; instead of &#8220;Id&#8221; and the field won&#8217;t come across.</p>
<p><strong>Second hint:</strong> All fields come across in quotes. This totally destroys any attempt to load numbers!</p>
<p>Here&#8217;s part of the database-conf.xml that I used:</p>
<pre class="brush: plain;">
&lt;bean id=&quot;extractMegaphoneQuery&quot;
      class=&quot;com.salesforce.dataloader.dao.database.SqlConfig&quot; singleton=&quot;true&quot;&gt;
    &lt;property name=&quot;sqlString&quot;&gt;
        &lt;value&gt;
            INSERT INTO renewals_megaphone (
               period, megaphone_date, opportunity_name, reason_lost, owner, expiry_date, product, years_owned)
            VALUES (@period@, @megaphone_date@, @opportunity_name@, @reason_lost@, @owner@,
                    @expiry_date@, @product@, @years_owned@)
        &lt;/value&gt;
    &lt;/property&gt;
    &lt;property name=&quot;sqlParams&quot;&gt;
        &lt;map&gt;
            &lt;entry key=&quot;period&quot;           value=&quot;bigint&quot;/&gt;
            &lt;entry key=&quot;megaphone_date&quot;   value=&quot;java.sql.Date&quot;/&gt;
            &lt;entry key=&quot;opportunity_name&quot; value=&quot;java.lang.String&quot;/&gt;
            &lt;entry key=&quot;reason_lost&quot;      value=&quot;java.lang.String&quot;/&gt;
            &lt;entry key=&quot;owner&quot;            value=&quot;java.lang.String&quot;/&gt;
            &lt;entry key=&quot;expiry_date&quot;      value=&quot;java.sql.Date&quot;/&gt;
            &lt;entry key=&quot;product&quot;          value=&quot;java.lang.String&quot;/&gt;
            &lt;entry key=&quot;years_owned&quot;      value=&quot;integer&quot;/&gt;
        &lt;/map&gt;
    &lt;/property&gt;
&lt;/bean&gt;
</pre>
<p>You&#8217;ll notice I have two fields that are numbers — <code>period</code> (bigint) and <code>years_owned</code> (integer). When trying to load these fields into my database, I kept getting the message:</p>
<p><code>Sql error: ERROR: column "period" is of type bigint but expression is of type character varying.<br />
org.postgresql.util.PSQLException: ERROR: <span style="color: #ff0000;">column "period" is of type bigint but expression is of type character varying</span></code></p>
<p>There was no way that I could convince DataLoader that the field was numeric — I tried lots of <code>java.lang.Integer</code> type entries in the <code>sqlParams</code>, but didn&#8217;t help.</p>
<p>I then changed the output to <code>csvWrite</code> instead of <code>databaseWrite</code> so that I could see the output, and it came through like this:</p>
<p><code>"PERIOD","MEGAPHONE_DATE","OPPORTUNITY_NAME","REASON_LOST","OWNER","EXPIRY_DATE","PRODUCT","YEARS_OWNED"<br />
"<span style="color: #ff0000;">83823.0</span>","2010-06-08","Joe Smith","Invalid","John","2010-03-14","a0624004000qRtkgA2","<span style="color: #ff0000;">3.0</span>"</code></p>
<p>You&#8217;ll notice that the first and last columns are meant to be numbers, but they are coming through in quotation marks. That&#8217;s what was causing the database load to fail!</p>
<p>So, I updated my SQL to convert the strings to numbers:</p>
<pre class="brush: plain;">
    &lt;property name=&quot;sqlString&quot;&gt;
        &lt;value&gt;
            INSERT INTO renewals_megaphone (
               period, megaphone_date, opportunity_name, reason_lost, owner, expiry_date, product, years_owned)
            VALUES (@period@::numeric, @megaphone_date@, @opportunity_name@, @reason_lost@, @owner@, @expiry_date@, @product@, @years_owned@::numeric)
        &lt;/value&gt;
    &lt;/property&gt;
</pre>
<p>This successfully cast the strings into numbers and they finally got stored in the database (which automatically ignored the decimal places when converting to <code>bigint</code> and <code>integer</code>).</p>
<p>I hope the blog post saves other people similar problems!</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>DataLoader can extract data and insert it into a database</li>
<li>Numbers are quoted on export and cause database errors</li>
<li>I type-cast the <code>string</code> into <code>numeric</code> to enable the database to load it</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/06/forcing-dataloader-to-extract-numbers-when-using-databasewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Owner available in Formulas</title>
		<link>http://theEnforcer.net/2010/06/making-owner-available-in-formulas/</link>
		<comments>http://theEnforcer.net/2010/06/making-owner-available-in-formulas/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 07:37:26 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Data Loader]]></category>
		<category><![CDATA[Force.com IDE]]></category>
		<category><![CDATA[formulas]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=228</guid>
		<description><![CDATA[I was configuring DataLoader to export a list of Opportunities, and I went to select the &#8220;Owner Name&#8221;. However, only OwnerID is available on an Opportunity.
&#8220;No problem!&#8221; I think to myself, as I go and create a Custom Field with a formula equal to Owner.Alias.
&#8220;What?&#8221; I say in surprise. &#8220;It won&#8217;t let me access a [...]]]></description>
			<content:encoded><![CDATA[<p>I was configuring DataLoader to export a list of Opportunities, and I went to select the &#8220;Owner Name&#8221;. However, only <code>OwnerID</code> is available on an Opportunity.</p>
<p>&#8220;No problem!&#8221; I think to myself, as I go and create a Custom Field with a formula equal to <code>Owner.Alias</code>.</p>
<p>&#8220;What?&#8221; I say in surprise. &#8220;It won&#8217;t let me access a field on the Owner object!&#8221;</p>
<p><img class="aligncenter size-full wp-image-229" title="NoLink" src="http://theEnforcer.net/wp-content/uploads/2010/06/NoLink.gif" alt="NoLink" width="302" height="136" /></p>
<p>Mmm. This is strange. Then a Google Search reveals an 18-month old Ideas request to <a href="http://sites.force.com/ideaexchange/apex/ideaview?id=08730000000BrqaAAC" target="_blank">Make &#8220;Owner Id&#8221; Look up fields available for formulas</a>.</p>
<p>Oh dear.</p>
<p>Well, that&#8217;s a shame, but it&#8217;s easily solved! I created:</p>
<ul>
<li>A field called <code>Owner_Link__c</code> of type <code>Lookup(User)</code></li>
<li>A Trigger to copy<code> OwnerId</code> to <code>Owner_Link__c</code> when the Owner is changed</li>
<li>A test for the Trigger</li>
</ul>
<p><strong>Trigger:</strong></p>
<pre class="brush: java;">
trigger Update_OwnerLink_on_Owner_Update on Opportunity (before update, before insert) {

  // When 'Owner' field is changed, update 'OwnerLink' too

	// Loop through the incoming records
	for (Opportunity o : Trigger.new) {

		// Has Owner chagned?
		if (o.OwnerID != o.Owner_Link__c) {
			o.Owner_Link__c = o.OwnerId;
		}
	}
}
</pre>
<p><strong>Test:</strong></p>
<pre class="brush: java;">
public with sharing class TriggerTest_OwnerLink {

	static TestMethod void testOwnerLink() {

		// Grab two Users
		User[] users = [select Id from User limit 2];
		User u1 = users[0];
		User u2 = users[1];

		// Create an Opportunity
		System.debug('Creating Opportunity');
		Opportunity o1 = new Opportunity(CloseDate = Date.newInstance(2008, 01, 01), Name = 'Test Opportunity', StageName = 'New', OwnerId = u1.Id);
		insert o1;

		// Test: Owner_Link should be set to user 1
		Opportunity o2 = [select id, OwnerId, Owner_Link__c from Opportunity where Id = &amp;#58o1.Id];
		System.assertEquals(u1.Id, o2.OwnerId);
		System.assertEquals(u1.Id, o2.Owner_Link__c);

		// Modify Owner
		o2.OwnerId = u2.Id;
		update o2;

		// Test: Owner_Link should be set to user 2
		Opportunity o3 = [select id, OwnerId, Owner_Link__c from Opportunity where Id = &amp;#58o2.Id];
		System.assertEquals(u2.Id, o3.OwnerId);
		System.assertEquals(u2.Id, o3.Owner_Link__c);
	}
}
</pre>
<p>This then gave me a new Owner object on my Opportunity on which I could create Formulas:</p>
<p><img src="http://theEnforcer.net/wp-content/uploads/2010/06/Result.png" alt="Result" title="Result" width="626" height="139" class="aligncenter size-full wp-image-234" /></p>
<p>I could also use it in the DataLoader by referring to <code>Owner_Link__r.Alias</code>.</p>
<p>Hooray!</p>
<p>Easy to solve, but it&#8217;s a shame it was necessary.</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>Formulas can&#8217;t access <code>Opportunity.Owner</code> fields</li>
<li>Create a &#8217;shadow&#8217; field to hold Owner and populate it via a Trigger</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/06/making-owner-available-in-formulas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New System Log Console looks deliciously good!</title>
		<link>http://theEnforcer.net/2010/05/new-system-log-console-looks-deliciously-good/</link>
		<comments>http://theEnforcer.net/2010/05/new-system-log-console-looks-deliciously-good/#comments</comments>
		<pubDate>Tue, 11 May 2010 07:17:10 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Apex]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=224</guid>
		<description><![CDATA[A new Salesforce blog post by Ümit Yalçinalp (whom I interviewed back at Dreamforce 2009) is showing some incredible new features for the System Log Console.

I first discovered the joys of the Console while trying to debug some Apex. I used it to call an Anonymous function to run my code, or sometimes I&#8217;d just [...]]]></description>
			<content:encoded><![CDATA[<p>A new <a href="http://blog.sforce.com/sforce/2010/05/sneak-peak-the-new-system-log-console.html">Salesforce blog post</a> by Ümit Yalçinalp (whom I <a href="http://theenforcer.net/2009/11/dreamforce-2009-day-0/">interviewed</a> back at Dreamforce 2009) is showing some incredible new features for the System Log Console.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://blog.sforce.com/.a/6a00d8341cded353ef01348096977b970c-500wi" alt="" /></p>
<p>I first discovered the joys of the Console while trying to debug some Apex. I used it to call an Anonymous function to run my code, or sometimes I&#8217;d just paste my whole code into the debug window and run it from there. It&#8217;s also a great place to <a href="http://theenforcer.net/2009/01/mass-delete/">run some quick code</a> to update records.</p>
<p>However, it&#8217;s not that great. It&#8217;s very hard to do good debugging in a web-based, multi-tenant environment. Some <a href="http://theenforcer.net/2010/03/new-system-log-window-is-great/">recent improvements</a> were quite nice but they look decidedly antiquated compared to what&#8217;s going to be released.</p>
<p>It seems that we&#8217;ll be able to step-through already-executed code. So, rather than pausing the whole Salesforce system, waiting for us to hit a &#8217;step&#8217; button (not great for a multi-tenant system!), it captures very detailed information and allows us to play back the executed code while viewing the execution stack and the lines of Apex code.</p>
<p>Very clever indeed!</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>A new System Log Console is being piloted</li>
<li>It&#8217;s giving amazing capabilities for a cloud-based system</li>
<li>See the <a href="http://blog.sforce.com/sforce/2010/05/sneak-peak-the-new-system-log-console.html">full article</a> for more details</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/05/new-system-log-console-looks-deliciously-good/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Report Builder on the way</title>
		<link>http://theEnforcer.net/2010/03/new-report-builder-on-the-way/</link>
		<comments>http://theEnforcer.net/2010/03/new-report-builder-on-the-way/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 23:06:57 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Reports]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=221</guid>
		<description><![CDATA[A while ago, I mentioned a survey from Salesforce regarding improved Analytics capabilities.
It appears that some form of Report enhancement is definitely on its way, because I logged a UI bug with the current Report Builder, and got this response:
The issue that you brought forward is, indeed, a bug, however it is being treated with [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I <a href="http://theEnforcer.net/2009/11/enhanced-analytics/">mentioned a survey from Salesforce regarding improved Analytics capabilities</a>.</p>
<p>It appears that some form of Report enhancement is definitely on its way, because I logged a UI bug with the current Report Builder, and got this response:</p>
<blockquote><p>The issue that you brought forward is, indeed, a bug, however it is being treated with a low priority right now as our developers are planning on replacing the current report builder with a new version &#8211; making this bug irrelevant.</p></blockquote>
<p>So, guess what&#8217;s probably coming in the next release!</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>A new Reporting system is on its way</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/03/new-report-builder-on-the-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New System Log window is great!</title>
		<link>http://theEnforcer.net/2010/03/new-system-log-window-is-great/</link>
		<comments>http://theEnforcer.net/2010/03/new-system-log-window-is-great/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 05:13:56 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Apex]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=216</guid>
		<description><![CDATA[Wow, I just noticed the new System Log window in Salesforce.com:

The first big improvement is the provision of a Log History. When executing code in the top half, the log file appears in the bottom half. This also works when data is updated through other means, such as editing a record. Previous logs can be [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, I just noticed the new System Log window in Salesforce.com:</p>
<p><img src="http://theEnforcer.net/wp-content/uploads/2010/03/System-Log.png" width="700" height="647" class="aligncenter size-full wp-image-217" border="1" /></p>
<p>The first big improvement is the provision of a Log History. When executing code in the top half, the log file appears in the bottom half. This also works when data is updated through other means, such as editing a record. Previous logs can be viewed by clicking. (I did, however, notice that it was a little slow when the log was large.)</p>
<p>Another little improvement is the way the &#8220;Execute&#8221; button changes to &#8220;Executing&#8230;&#8221; when clicked. I have always been confused over this, because the window appears to &#8216;hang&#8217; when executing time-intensive code (eg looping over many records) and I could never tell if the command was correctly transmitted.</p>
<p>Thank you, Salesforce development team!</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>The System Log window has been updated</li>
<li>Multiple log histories are available</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/03/new-system-log-window-is-great/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force.com book now on Amazon</title>
		<link>http://theEnforcer.net/2010/01/force-com-book-now-on-amazon/</link>
		<comments>http://theEnforcer.net/2010/01/force-com-book-now-on-amazon/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 03:33:25 +0000</pubDate>
		<dc:creator>The Enforcer</dc:creator>
				<category><![CDATA[Dreamforce]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<category><![CDATA[people]]></category>

		<guid isPermaLink="false">http://theEnforcer.net/?p=201</guid>
		<description><![CDATA[During Dreamforce 2009, I had the pleasure of meeting Jason Ouellette, the Chief Architect at Appirio. Appirio is a well-known name when it comes to Force.com development, having been involved in some major Force.com projects such as Japan Post and the systems shown at the Dreamforce 2009 keynote (including Chatter stuff before it was even [...]]]></description>
			<content:encoded><![CDATA[<p>During Dreamforce 2009, I had the pleasure of meeting <strong>Jason Ouellette</strong>, the Chief Architect at Appirio. <a href="http://www.appirio.com/">Appirio</a> is a well-known name when it comes to Force.com development, having been involved in some major Force.com projects such as Japan Post and the systems shown at the Dreamforce 2009 keynote (including Chatter stuff before it was even released!).</p>
<p>Jason has recently released a book dedicated to Force.com Development. It&#8217;s called <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2F0321647734%2F&amp;tag=balptylim-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Development with the Force.com Platform: Building Business Applications in the Cloud</a><img class=" qvgwhekfxvevnzjinjeo qvgwhekfxvevnzjinjeo qvgwhekfxvevnzjinjeo qvgwhekfxvevnzjinjeo" style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=balptylim-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /> and, aside from having the world&#8217;s longest title, is also the world&#8217;s first book on Force.com (that wasn&#8217;t written by Salesforce).</p>
<p><center><a href="http://www.amazon.com/gp/product/0321647734?ie=UTF8&amp;tag=balptylim-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321647734"><img src="http://theEnforcer.net/wp-content/uploads/2010/01/ForceBook-233x300.jpg" border="0" alt="" /><br />
<strong><br/>Jason&#8217;s Force.com Book</strong></a><img class=" qvgwhekfxvevnzjinjeo qvgwhekfxvevnzjinjeo qvgwhekfxvevnzjinjeo qvgwhekfxvevnzjinjeo qvgwhekfxvevnzjinjeo" style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=balptylim-20&amp;l=as2&amp;o=1&amp;a=0321647734" border="0" alt="" width="1" height="1" /></center></p>
<p>The book covers practically every topic relating to Force.com which is, as you probably know, an awful lot of information! As such, having only 400 pages, the book is more of an introductory tutorial than a reference book. Indeed, Jason fully admits that people will still need to refer to the standard PDFs to get detailed technical information.</p>
<p>So, who is the book good for? Definitely for anyone having to code Force.com who is relatively new to Salesforce and Force.com. It mentions all the technologies available in Force.com, so is vital for people wanting to come to grips with the platform.</p>
<p>If you&#8217;re a developer already using Force.com and you&#8217;ve used the Salesforce platform for 2+ years, then this book isn&#8217;t going to teach you anything new. However, it is rare that a developer has played with every feature in Force.com (eg I&#8217;ve never played with approvals, Salesforce-to-Salesforce, DML rollbacks, Visualforce JavaScript actions), so the book can even teach old dogs a trick or two.</p>
<p>For further insight into the book, see <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2Freview%2FR3M90VUOVLB4Y0%2F&#038;tag=balptylim-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">my review on Amazon.com</a><img src="http://www.assoc-amazon.com/e/ir?t=balptylim-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.</p>
<p>Now for a real treat. While at Dreamforce, I managed to snag an interview with Jason, so here he is talking about his own book:</p>
<p><center><object width="660" height="405"><param name="movie" value="http://www.youtube.com/v/2Emj-KJdqH4&#038;hl=en_US&#038;fs=1&#038;color1=0xe1600f&#038;color2=0xfebd01&#038;border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/2Emj-KJdqH4&#038;hl=en_US&#038;fs=1&#038;color1=0xe1600f&#038;color2=0xfebd01&#038;border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="660" height="405"></embed></object></center></p>
<p>Thanks for the interview, Jason!</p>
<h3>The Bottom Line</h3>
<ul class="nomargin">
<li>Force.com now has its first book!</li>
<li>It&#8217;s great for people new to Force.com, might not be so helpful to already-experienced Force.com developers</li>
<li>Jason Ouellette&#8217;s a really nice guy!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://theEnforcer.net/2010/01/force-com-book-now-on-amazon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
