<?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>X-Squared On-Demand &#187; Native Application</title>
	<atom:link href="http://www.x2od.com/cat/salesforce/nativeapp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.x2od.com</link>
	<description>Salesforce Configuration, Administration, and Development</description>
	<lastBuildDate>Fri, 11 Jun 2010 16:30:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sophisticated DateTime &#8220;Formula Fields&#8221; with Apex and Field-Level Security</title>
		<link>http://www.x2od.com/2010/05/17/sophisticated-datetime-formula-fields-with-apex-and-fls.html</link>
		<comments>http://www.x2od.com/2010/05/17/sophisticated-datetime-formula-fields-with-apex-and-fls.html#comments</comments>
		<pubDate>Mon, 17 May 2010 20:39:25 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Salesforce CRM]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[Eclipse IDE]]></category>
		<category><![CDATA[Force.com Builder]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=997</guid>
		<description><![CDATA[What do you do when you want to calculate a formula-like field but a regular formula won't work? Salesforce CRM's formulas handle dates very well. If you want to enter a date value and have formula fields display, for instance, mydate__c + 21 days, that's simple. Just use mydate__c + 21. Side note: If you [...]]]></description>
			<content:encoded><![CDATA[<p>What do you do when you want to calculate a formula-like field but a regular formula won't work?  </p>
<p>Salesforce CRM's formulas handle dates very well.  If you want to enter a date value and have formula fields display, for instance, mydate__c + 21 days, that's simple.  Just use <code> mydate__c + 21</code>.</p>
<p><i>Side note: If you try going the long way around and use <code>DATE( YEAR( mydate__c ), MONTH( mydate__c ), DAY( mydate__c ) + 21 ) </code> and mydate__c = 09/17/2010, Salesforce returns #Error! because there's no date 09/38/2010.  Similarly, adding three months to a date like 1/31/2010 will also give an error.  More about this in a future post.</i></p>
<p>DateTime fields are like Date fields, but they include... wait for it... a time component (and can be created in the running user's local time zone or in GMT).</p>
<p>Here's a use-case for a DateTime formula field:</p>
<p>A photography studio schedules photo shoots, and different packages include different durations.  Similarly, we could use a hair salon which offers different services, each with a different duration, a dentist... you get the idea.</p>
<p>Requirements:</p>
<ol>
	<li>Enter a DateTime for an appointment start time (<code>starttime__c</code>)</li>
	<li>Enter a duration (though in a production system, I'd include a value on the <code>Product2</code> sObject, we'll just enter a value here) (<code>minutes__c</code>)</li>
	<li>Display a read-only DateTime field with the end time (<code>endtime__c</code>)</li>
	<li>The end time must be read-only to all users, like any formula field</li>
</ol>
<p>Here's what won't work:</p>
<ul>
	<li>A formula field won't work because there are no MINUTE(), HOUR(), SECOND() formula functions</li>
	<li>Workflow won't work because it depends on formulas to fill new values for date/datetime fields</li>
</ul>
<p>That leaves Apex.  First, the configuration:</p>
<ol>
	<li>Create DateTime field <code>starttime__c</code></li>
	<li>Create DateTime field <code>endtime__c</code></li>
	<li>Set <code>endtime__c</code> field-level security to Read-Only for all profiles</li>
	<li>Create Number (18,0) field <code>minutes__c</code></li>
	<li>Create a trigger on the sobject</li>
</ol>
<p>Here's the trigger:</p>
<pre class="brush: java;">
trigger timeTrigger on TestObject__c (before insert, before update) {
    for (TestObject__c t : Trigger.New){
    	if(t.StartTime__c != null &amp;&amp; t.minutes__c != null){
        datetime myDateT = t.StartTime__c;
        double d = t.minutes__c;
        Integer shootmins = d.intValue();
        if(mydateT != null &amp;&amp; shootmins != null)
        	t.EndTime__c = myDateT.addminutes(integer.valueof(shootmins));
       	}
    }
} 
</pre>
<p>Regular readers will note that I do usually split triggers into a trigger and a class, but I've not done so here purely for the sake of brevity.</p>
<p>Here's the test code:</p>
<pre class="brush: java;">
public without sharing class shootTimesTriggerTest {

    private static testMethod void ShootCalculateEndTime_PositiveTestCases() {
        TestObject__c to;
        TestObject__c l;    
        test.starttest();
        l = new TestObject__c (name = 'test');
        datetime myDateTime = datetime.newInstance(2008, 12, 1, 12, 30, 2);
        l.StartTime__c = myDateTime;
        l.minutes__c = 90;
        insert l;
        to = [SELECT id, EndTime__c FROM TestObject__c WHERE id = :l.id];
        datetime newDateTime = datetime.newInstance(2008, 12, 1, 14, 0, 2);
        system.assertequals(to.EndTime__c, newDateTime);
        l.minutes__c = 45;
        update l;        
        to = [SELECT id, EndTime__c FROM TestObject__c WHERE id = :l.id];
        newDateTime = datetime.newInstance(2008, 12, 1, 13, 15, 2);
        system.assertequals(to.EndTime__c, newDateTime);
        test.stoptest();
    }

    private static testMethod void OppCalculateEndTime_NegativeTestCases() {
        test.starttest();
        TestObject__c l = new TestObject__c (name = 'test');
        l.minutes__c = null;
        insert l;
        system.assertequals(l.EndTime__c, null);
        test.stoptest();
    } 
}
</pre>
<p>A few points about how this works:</p>
<ul>
	<li>Triggers run in System mode, so they don't respect field-level security.  Thus, we can set a field to read-only for all profiles, and the EndTime__c field will still be updated.</li>
	<li>The test code runs in System mode as well, avoiding any potential problems if the field were set to invisible to a profile and we used System.RunAs() to test for various profiles.</li>
	<li>Although I'm not a fan of using SOQL queries this often, I used these in the interest of saving time.  Keep in mind that if you had quite a few queries in your regular code, adding these two might put you over the limit, so use queries sparingly!</li>
	<li>This is the only way I know of to add minutes to a DateTime.</li>
</ul>
<p>Did I miss anything?  Please let me know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2010/05/17/sophisticated-datetime-formula-fields-with-apex-and-fls.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Filtered Lookups, Validation Rules, and Order of Execution</title>
		<link>http://www.x2od.com/2009/10/06/filtered-lookups-validation-rules-and-order-of-execution.html</link>
		<comments>http://www.x2od.com/2009/10/06/filtered-lookups-validation-rules-and-order-of-execution.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 15:47:34 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Winter 10]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<category><![CDATA[Force.com Platform]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=771</guid>
		<description><![CDATA[Reading the cheatsheet for Filtered Lookup (beta), I noticed an interesting line: Lookup filters function similarly to validation rules when you save a record. That is, actions that cause related records to save, such as changes to a roll-up summary fields, also trigger the lookup filters on the related record and block the save. The [...]]]></description>
			<content:encoded><![CDATA[<p>Reading the <a href="http://drop.io/ds/asset/filtered-lookup-cheatsheet-beta">cheatsheet for Filtered Lookup (beta)</a>, I noticed an interesting line:</p>
<p><code>Lookup filters function similarly to validation rules when you save a record. That is, actions that cause related records to save, such as changes to a roll-up summary fields, also trigger the lookup filters on the related record and block the save.</code></p>
<p>The implications for this are massive.  Let's explore two examples:</p>
<p><strong>Example 1: Filter as Validation Rule from Parent Record</strong></p>
<ul>
	<li>We create a lookup on a Child object to Parent.</li>
	<li>We filter the lookup to EXCLUDE Parent.Status = 'Closed' (Parent.Status is only Open or Closed.)</li>
	<li>We can edit the Child records as long as the Parent Status is not Closed.</li>
	<li>When Parent.Status is changed to Closed, existing related Child records are not affected...</li>
	<li><strong>BUT</strong> if we attempt to edit a Child when the Parent is Closed, Force.com will throw an error (which we can customize) beause that the Lookup is invalid.</li>
	<li>(and clearly we cannot add new Child records either)</li>
</ul>
<p><strong>Conclusion:</strong> Thus, Filtered Lookups act much like Validation Rules.  A quick experiment shows that Filtered Lookup errors actually fire <u>before</u> Validation Rules.</p>
<p><strong>Example 2: Filter as Validation Rule on Roll-Up Summary (from Child Record)</strong> - what the line above was referencing</p>
<ul>
	<li>Use the above example, but change the lookup to a master-detail relationship</li>
	<li>Create a Roll-Up Summary field to count all child records</li>
	<li>Prevent saving more than 10 child records for one parent record</li>
</ul>
<p>Here, we have triggered a filter error without touching a parent record, yet we throw an error based on a value on the parent record.</p>
<p>This second example is significant because we could already prevent more than 10 child records from saving, 
but doing so required a Roll-Up Summary field on the parent object AND a Validation Rule on the child object.  
Now we can replace the Validation Rule with the Lookup Filter, though we still need the Roll-Up Summary field.
Whether or not this simplifies things is definitely up for debate...</p>

<h4>Conclusion</h4>
<p>This is a very powerful feature!  Thanks to salesforce.com for rolling it out, even in beta form.</p>
<p><strong>Real world example:</strong> The above example would be great for Time Sheet Entry and Time Sheet Header objects, as they would create, in effect, a validation rule on the Header record preventing editing of any child records.  Awesome!</p>
<P><em>For further reading, check <a href="https://na1.salesforce.com/help/doc/user_ed.jsp?loc=help&target=fields_lookup_filters_examples.htm">Salesforce Help's Lookup Filters examples</a>.</em></p>]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2009/10/06/filtered-lookups-validation-rules-and-order-of-execution.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Preparing a New Org</title>
		<link>http://www.x2od.com/2009/09/16/preparing-a-new-org.html</link>
		<comments>http://www.x2od.com/2009/09/16/preparing-a-new-org.html#comments</comments>
		<pubDate>Wed, 16 Sep 2009 18:44:59 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[New Features]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=717</guid>
		<description><![CDATA[Every time one encounters a fresh org, there are maintenance tasks to perform. I usually go through an org (whether a Developer Edition org or a Prerelease version) and do the same tasks, generally in no particular order. This time, however, I wrote down what I did as I did it. Looking at the list, it's hardly in any "best practices" order at all - it's just how I did it.

There's no need to follow every step, and it is not a complete list of all possibilities, but this should give you some idea of the possibilities and available tweaks: (*** indicates some of the new features in WInter '10)]]></description>
			<content:encoded><![CDATA[<p>With the impending arrival of the Winter 2010 (aka 162 or Winter'10) edition of Salesforce CRM, 
as with every other release, comes a prerelease org.  (You can get one at 
<a href="https://www.salesforce.com/form/trial/prerelease_winter10.jsp">https://www.salesforce.com/form/trial/prerelease_winter10.jsp</a>.)</p>
<p>Every time one encounters a fresh org, there are maintenance tasks to perform.  I usually go through an org (whether a Developer Edition 
org or a Prerelease version) and do the same tasks, generally in no particular order.  This time, however, I wrote down what I did as I did it.  Looking at the list, it's hardly in any
"best practices" order at all - it's just how I did it.</p>
<p>There's no need to follow every step, and it is not a complete list of all possibilities, but this should give you some idea of the possibilities and available tweaks: (*** indicates some of the new features in WInter '10)</p>
<ol>
	<li>Save login with 1Password/Roboform</li>
	<li>Reset (Set) Security Token</li>
	<li>Administration Setup | Security Controls</li>
<ul>
	<li>Session time 8 hrs
	<li>Passwords never expire</li>
</ul>
	<li>Create Record Types (and Business Processes) for Lead, Opportunity, Case</li>
	<li>(Campaigns were not enabled in this prerelease org) - would have configured them here, similarly</li>
	<li>Activities section: Calendar link on sidebar</li>
	<li>Download latest versions of Connect for Outlook, Office Edition</li>
	<li>Opportunities:</li>
<ul>
	<li>Enable Similar Opportunities</li>
	<li>Enable Opportunity Teams</li>
</ul>

	<li>Create Account Master Record Type</li>
	
	<li>Enable Account Teams</li>
<li>Create Contact Master Record Type</li>
<ul><li><i>Note: Asked to add to page layout.  Not asked for Opportunities.</i></li></ul>
	<li>Enable Case Teams</li>
	<li>Enable Public Solutions</li>
	<li>Solutions:</li>
<ul>
	<li>Enable Solution Browsing</li>
	<li>Enable Solution HTML</li>
<li>Could have created a Solution Process & Record Type</li>
	<li>Did not enable multilingual solutions</li>
</ul>
	<li>Enable Self-Service</li>
	<li>Enable Web-to-Case</li>
	<li>Create default Owner, etc (auto prompted)</li>
	<li>Enable PRM and Partner Portal (though have no licenses)</li>
	<li>Salesforce to Salesforce</li>
<ul>
<li>Enabled S2S</li>

	<li>Set up S2S Connection Finder ***</li>
	<li>Added fields to page layout - Kept read-only for all profiles except System Administrator</li>
	<li>Enable Public & Private Tags</li>
</ul>
	<li>Enable Console for all Profiles</li>
	<li>Search Settings - Enable Enhanced Lookup & Auto-Complete</li>
	<li>User Interface</li>
	<ul>
	<li>Separate loading of related lists</li>
	<li>Spell Checker on Tasks & Events</li>
	<li>Collapsible Sidebar</li>
	<li>Custom Sidebar on all Pages</li>
	<li>Enhanced Profile Management ***</li>
	</ul>
	<li>Set myself as default Workflow User</li>
	<li>Looked at Develop | Custom Settings ***</li>
	<li>Created a Default Queue and added myself</li>
	<li>Set all Sharing Rules to Private</li>
	<li>Update Home Page to the way I like it</li>
<ul>
<li>Order of wide section (top down): Calendar, Tasks, Items to Approve, Dashboard</li>
<li>No changes to narrow section</li>
</ul>
</ol>
<p> Other things that may be possible in other orgs:</p>
<ul>
	<li>Enable Customer Portal</li>
	<li>Customize Campaigns</li>
	<li>Set up Sites</li>

</ul>
<p>Again, this is not meant to be a complete list.  Also, it is not intended to be a how-to; for more information you may search the Help link
at the top of every org page, check <a href="http://www.salesforce.com/community">Salesforce Community</a>, or <a href="http://developer.force.com">Developer Force</a>.</p>
<p>Happy configuring!</p?


]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2009/09/16/preparing-a-new-org.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Dashboards are Improved AND New in Summer 09</title>
		<link>http://www.x2od.com/2009/05/07/dashboards-are-improved-and-new-in-summer-09.html</link>
		<comments>http://www.x2od.com/2009/05/07/dashboards-are-improved-and-new-in-summer-09.html#comments</comments>
		<pubDate>Thu, 07 May 2009 21:54:18 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Summer 09]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<category><![CDATA[Salesforce.com]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=509</guid>
		<description><![CDATA[The Summer09 prerelease orgs are here, so <a href="https://prerelwww.pre.salesforce.com/form/trial/prerelease_summer09.jsp">get yours now</a>!  Upon first look, something cool stood out and merits immediate posting:

Dashboards are improved.  The colors are more vivid, there's detail in the bars and pie chart wedges, and... pie charts can now display the actual and percentage values!]]></description>
			<content:encoded><![CDATA[<p>The Summer09 prerelease orgs are here, so <a href="https://prerelwww.pre.salesforce.com/form/trial/prerelease_summer09.jsp">get yours now</a>!  Upon first look, something cool stood out and merits immediate posting:</p>
<p>Dashboards are improved.  The colors are more vivid, there&#8217;s detail in the bars and pie chart wedges, and&#8230; pie charts can now display the actual <em>and</em> percentage values!</p>
<p>Dashboards are also new.  Visualforce pages can now be included as dashboard components, and there&#8217;s a new &#8220;Color-Blind Palette on Charts&#8221; setting for each user.  Here are before and after shots.</p>
<div id="attachment_507" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.x2od.com/wp/uploads/dashboard-regular.jpg"><img src="http://www.x2od.com/wp/uploads/dashboard-regular-300x168.jpg" alt="Dashboard with regular color scheme" title="dashboard-regular" width="300" height="168" class="size-medium wp-image-507" /></a><p class="wp-caption-text">Salesforce dashboard with regular color scheme</p></div>
<div id="attachment_508" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.x2od.com/wp/uploads/dashboard-cb.jpg"><img src="http://www.x2od.com/wp/uploads/dashboard-cb-300x224.jpg" alt="Salesforce dashboard with color-blind/alternate color scheme" title="dashboard-cb" width="300" height="224" class="size-medium wp-image-508"  /></a><p class="wp-caption-text">Dashboard with color-blind/alternate color scheme</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2009/05/07/dashboards-are-improved-and-new-in-summer-09.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flexible Field Labels</title>
		<link>http://www.x2od.com/2009/03/23/flexible-field-labels.html</link>
		<comments>http://www.x2od.com/2009/03/23/flexible-field-labels.html#comments</comments>
		<pubDate>Mon, 23 Mar 2009 21:02:46 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Visualforce]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[Force.com Platform]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=439</guid>
		<description><![CDATA[While making a Visualforce page to display a Zip/Country -> City, State, County application, it became obvious that labeling fields manually will not satisfy all users, especially international ones. There are a few ways to include a field and its label on a Visualforce page. The simplest, using OutputField: VF Page (simple): &#60;apex:page standardcontroller=&#34;Account&#34;&#62; &#60;apex:pageblock&#62; [...]]]></description>
			<content:encoded><![CDATA[While making a Visualforce page to display a Zip/Country -> City, State, County application, it became obvious that labeling fields manually will not satisfy all users, especially international ones.  

There are a few ways to include a field and its label on a Visualforce page.  

<span id="more-439"></span>
<p>The simplest, using OutputField:<br>
<strong>VF Page (simple):</strong>
<pre class="brush: xml;">
&lt;apex:page standardcontroller=&quot;Account&quot;&gt;
&lt;apex:pageblock&gt;
&lt;apex:pageblocksection&gt;
&lt;apex:outputField value=&quot;{!Account.Name}&quot; /&gt;
&lt;/apex:pageblocksection&gt;
&lt;/apex:pageblock&gt;
&lt;/apex:page&gt;
</pre>

<a href="http://www.x2od.com/2009/03/23/flexible-field-labels.html/code1" rel="attachment wp-att-451"><img src="http://www.x2od.com/wp/uploads/code1.png" alt="code1" title="code1" width="386" height="57" class="aligncenter size-full wp-image-451" /></a><p><p>

The most common (based on code shares and other observations) method allows one to use a label other than the one in Salesforce.  It also allows combining of multiple fields while maintaining the standard style:<br>
<strong>VF Page (common, but static):</strong>
<pre class="brush: xml;">
&lt;apex:page standardcontroller=&quot;Account&quot;&gt;
&lt;apex:pageblock&gt;
&lt;apex:pageblocksection columns=&quot;1&quot;&gt;
&lt;apex:pageblocksectionitem&gt;
&lt;apex:outputLabel value=&quot;Account Name&quot; for=&quot;an&quot; /&gt;
&lt;apex:outputText value=&quot;{!Account.Name}&quot; id=&quot;an&quot; /&gt;
&lt;/apex:pageblocksectionitem&gt;
&lt;apex:pageblocksectionitem&gt;
&lt;apex:outputLabel value=&quot;City, State, Zip&quot; for=&quot;csz&quot; /&gt;
&lt;apex:outputText value=&quot;{!Account.BillingCity}, {!Account.BillingState} {!Account.BillingPostalCode}&quot; /&gt;
&lt;/apex:pageblocksectionitem&gt;
&lt;/apex:pageblocksection&gt;
&lt;/apex:pageblock&gt;
&lt;/apex:page&gt;
</pre>

<a href="http://www.x2od.com/2009/03/23/flexible-field-labels.html/code2" rel="attachment wp-att-450"><img src="http://www.x2od.com/wp/uploads/code2.png" alt="code2" title="code2" width="401" height="99" class="aligncenter size-full wp-image-450" /></a><p><p>

And a way to allow field label renaming and translations:<br>
<strong>VF Page (more flexible, allowing for renaming and translations):</strong>
<pre class="brush: xml;">
&lt;apex:page standardcontroller=&quot;Account&quot;&gt;
&lt;apex:pageblock&gt;
&lt;apex:pageblocksection columns=&quot;1&quot;&gt;
&lt;apex:pageblocksectionitem&gt;
&lt;apex:outputLabel value=&quot;{!$ObjectType.account.fields.name.label}&quot;  for=&quot;an&quot; /&gt;
&lt;apex:outputText value=&quot;{!Account.Name}&quot; id=&quot;an&quot; /&gt;
&lt;/apex:pageblocksectionitem&gt;
&lt;apex:pageblocksectionitem&gt;
&lt;apex:outputLabel value=&quot;{!$ObjectType.account.fields.billingcity.label}, {!$ObjectType.account.fields.billingstate.label}, {!$ObjectType.account.fields.billingpostalcode.label}&quot; for=&quot;csz&quot; /&gt;
&lt;apex:outputText value=&quot;{!Account.BillingCity}, {!Account.BillingState} {!Account.BillingPostalCode}&quot; id=&quot;csz&quot;/&gt;
&lt;/apex:pageblocksectionitem&gt;
&lt;/apex:pageblocksection&gt;
&lt;/apex:pageblock&gt;
&lt;/apex:page&gt;
</pre>

<a href="http://www.x2od.com/2009/03/23/flexible-field-labels.html/code3" rel="attachment wp-att-449"><img src="http://www.x2od.com/wp/uploads/code3.png" alt="code3" title="code3" width="413" height="106" class="aligncenter size-full wp-image-449" /></a><p><p><p>
So by using <strong>$ObjectType.account.fields.billingcity.label</strong> (and similar markup for other objects and fields) we can allow org-specific customizations to come into our code with no effort required.
<p>
There's a catch (there always is).  Note that there is no way to combine the three fields for City, State, and Zip (while using automatic renaming to help us with any customizations that the org has made) while maintaining proper labeling.  In this case, the label for the combined field would be "<strong>Billing City, Billing State, Billing Zip/PostalCode</strong>."  In other words, we can use whatever the org prefers for each field, but the developer must choose the label, which must remain static.<p>
The more astute administrators and developers will note that there is a solution available: Use a component and pass the field labels displayed to the component.  Then, using custom labels and translations, the component could be made truly international.  This is, however, beyond the scope of this post.  But it is an idea for a future post...<p>
And the most astute amongst you are probably saying, "A truly flexible labeling system would allow the word "State" for a US address, "Province" for Canadian and others, and would still be completely customizable and translatable.  Yes, that would be nice.  :)]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2009/03/23/flexible-field-labels.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Force.com Sites Guest User Profile Permissions</title>
		<link>http://www.x2od.com/2008/12/22/sites-guest-profile.html</link>
		<comments>http://www.x2od.com/2008/12/22/sites-guest-profile.html#comments</comments>
		<pubDate>Mon, 22 Dec 2008 16:54:39 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Winter 09]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<category><![CDATA[Sites]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=294</guid>
		<description><![CDATA[I&#8217;m working on an event registration application for the Sites Developer Challenge, and it involves a validation that the registrant&#8217;s email exists in a Contact record. Remembering that Steve Andersen had run into some obstacles with Contact.Email visibility, I decided to check the guest profile for Contact Field Level Security. Here&#8217;s what I found: If [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on an event registration application for the <a href="http://developer.force.com/developerchallenge">Sites Developer Challenge</a>, and it involves a validation that the registrant&#8217;s email exists in a Contact record.  Remembering that <a href="http://community.salesforce.com/sforce/board/message?message.uid=96974#U96974">Steve Andersen had run into some obstacles</a> with Contact.Email visibility, I decided to check the guest profile for Contact Field Level Security.  Here&#8217;s what I found:</p>
<div id="attachment_295" class="wp-caption alignnone" style="width: 521px"><img src="http://www.x2od.com/wp/uploads/sitesguestcontactfls.jpg" alt="Guest profile Contact Field Level Security" title="sitesguestcontactfls" width="50%" height="50%" class="size-full wp-image-295" /><p class="wp-caption-text">Guest profile Contact Field Level Security</p></div>
<p>If you squint a bit, you can see that the Opt-Out and Email fields are hidden to the guest user.  I have no idea why these, in particular, are hidden.  Likewise, I couldn&#8217;t find a pattern in which fields were shown on the custom objects I had created, nor which were visible on standard objects.</p>
<p>In any event, I don&#8217;t have any pearls of wisdom on this topic; this is more of an informative note to all that are using Sites (especially if you plan to do any communication-subscriptions) to check out the Field-Level Security.</p>
<p>For those wondering how to get to this Profile (since it is not visible in the usual Profile section), go to the Sites page > Site Name or URL > Public Access Settings (a button).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2008/12/22/sites-guest-profile.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inline Visualforce Page Layouts!</title>
		<link>http://www.x2od.com/2008/11/29/inline-visualforce-page-layouts.html</link>
		<comments>http://www.x2od.com/2008/11/29/inline-visualforce-page-layouts.html#comments</comments>
		<pubDate>Sat, 29 Nov 2008 23:42:20 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<category><![CDATA[New Developments]]></category>
		<category><![CDATA[Visualforce]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=269</guid>
		<description><![CDATA[We're all used to using inline S-Controls, dragging and dropping them into page layouts.  And the entire Salesforce community has been spending tons of time recreating page layouts in Visualforce, just to edit one small piece of a page.

As an example, how would you implement the example at developer.force.com: <a href="http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage">Visualforce Dynamic Edit Page</a>?  You would do it the way it was explained in the blog post!

Well the rules of the game have changed.]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://blog.sforce.com/sforce/2008/11/adding-a-visualforce-page-to-a-page-layout.html">This is huge news!</a></strong></p>
<p>We&#8217;re all used to using inline S-Controls, dragging and dropping them into page layouts.  And the entire Salesforce community has been spending tons of time recreating page layouts in Visualforce, just to edit one small piece of a page.</p>
<p>As an example, how would you implement the example at developer.force.com: <a href="http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage">Visualforce Dynamic Edit Page</a>?  You would do it the way it was explained in the blog post!</p>
<p>Well the rules of the game have changed.</p>
<p>As long as you use a Standard Controller, <a href="http://blog.sforce.com/sforce/2008/11/adding-a-visualforce-page-to-a-page-layout.html"><strong>you can now place Visualforce pages IN regular page layouts</strong></a>!</p>
<div class="wp-caption alignnone" style="width: 510px"><img width=497 height=309 alt="Inline Visualforce Page Layout screenshot" src="http://blog.sforce.com/.a/6a00d8341cded353ef0105361c5757970b-pi" title="Inline Visualforce Page Layout" width="829" height="515" /><p class="wp-caption-text">Inline Visualforce Page Layout screenshot</p></div>
<p>The article was written by Sati Hillyear, who is also an expert on the License Manager Application.  Check it out!</p>
<p>[<em>Addendum 5-9-2009:</em> For another example of this, see <a href="http://blog.jeffdouglas.com/2009/05/08/inline-visualforce-pages-with-standard-page-layouts/">Jeff Douglas' blog post</a>.]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2008/11/29/inline-visualforce-page-layouts.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Salesforce Order of Execution</title>
		<link>http://www.x2od.com/2008/11/09/salesforce-order-of-execution.html</link>
		<comments>http://www.x2od.com/2008/11/09/salesforce-order-of-execution.html#comments</comments>
		<pubDate>Sun, 09 Nov 2008 09:25:43 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Apex]]></category>
		<category><![CDATA[Force.com Builder]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=230</guid>
		<description><![CDATA[I came across this page in the Apex documentation and wanted to share it with everyone.  So many people have asked about this in the past, so it seems a good idea to publicize it:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm]]></description>
			<content:encoded><![CDATA[<p>I came across this page in the Apex documentation and wanted to share it with everyone.  So many people have asked about this in the past, so it seems a good idea to publicize it:</p>
<p><a href="http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm">http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm</a></p>
<p><strong>Triggers and Order of Execution</strong></p>
<p>When a record is saved with an insert, update, or upsert statement, the following events occur in order:</p>
<p>   1. The original record is loaded from the database (or initialized for an insert statement)<br />
   2. The new record field values are loaded from the request and overwrite the old values<br />
   3. All before triggers execute<br />
   4. System validation occurs, such as verifying that all required fields have a non-null value, and running any user-defined validation rules<br />
   5. The record is saved to the database, but not yet committed<br />
   6. All after triggers execute<br />
   7. Assignment rules execute<br />
   8. Auto-response rules execute<br />
   9. Workflow rules execute<br />
  10. If there are workflow field updates, the record is updated again<br />
  11. If the record was updated with workflow field updates, before and after triggers fire one more time (and only one more time)<br />
  12. Escalation rules execute<br />
  13. All DML operations are committed to the database<br />
  14. Post-commit logic executes, such as sending email</p>
<p><strong>Additional Considerations</strong></p>
<p>Please note the following when working with triggers:</p>
<p>    * When Enable Validation and Triggers from Lead Convert is selected, if the lead conversion creates an opportunity and the opportunity has Apex before triggers associated with it, the triggers run immediately after the opportunity is created, before the opportunity contact role is created. For more information, see &#8220;Customizing Lead Settings&#8221; in the Salesforce online help.<br />
    * If you are using before triggers to set Stage and Forecast Category for an opportunity record, the behavior is as follows:<br />
          o If you set Stage and Forecast Category, the opportunity record contains those exact values.<br />
          o If you set Stage but not Forecast Category, the Forecast Category value on the opportunity record defaults to the one associated with trigger Stage.<br />
          o If you reset Stage to a value specified in an API call or incoming from the user interface, the Forecast Category value should also come from the API call or user interface. If no value for Forecast Category is specified and the incoming Stage is different than the trigger Stage, the Forecast Category defaults to the one associated with trigger Stage. If the trigger Stage and incoming Stage are the same, the Forecast Category is not defaulted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2008/11/09/salesforce-order-of-execution.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Salesforce CRM &#8220;Locale&#8221; Field</title>
		<link>http://www.x2od.com/2008/10/23/salesforce-crm-locale-field.html</link>
		<comments>http://www.x2od.com/2008/10/23/salesforce-crm-locale-field.html#comments</comments>
		<pubDate>Thu, 23 Oct 2008 17:50:36 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<category><![CDATA[Salesforce.com]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=222</guid>
		<description><![CDATA[I wanted to change the first day of my week to Monday, and to see my weekends on the right-side of the 7-day view.  I've started doing this on my Google and Outlook calendars, so why not be consistent? ]]></description>
			<content:encoded><![CDATA[<p>Most of the people reading this are probably in the United States, so on our User record, we have Locale set to &#8220;English (US).&#8221;  This has a few effects on how we see Salesforce data, including the Calendar.</p>
<p>I wanted to change the first day of my week to Monday, and to see my weekends on the right-side of the 7-day view.  I&#8217;ve started doing this on my Google and Outlook calendars, so why not be consistent?  To do this, I changed my Locale to &#8220;English (United Kingdom).&#8221;  </p>
<p>There&#8217;s a catch (there always is!): My dates are now reversed.  D&#8217;Oh!</p>
<p>Time will tell if I have any other major changes to the org.  I don&#8217;t mind British spellings (colour vs. color) &#8212; though I&#8217;ve found the word &#8220;color&#8221; three times since I switched.  The org currency will remain US Dollars, as that is set elsewhere, in the Company Profile.</p>
<p>So what will I do, on the whole?  I need to decide if the date format is more or less important than the week format.  I&#8217;ll try out this UK thing&#8230; and will decide later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2008/10/23/salesforce-crm-locale-field.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Docs Now Has Templates for Google Apps</title>
		<link>http://www.x2od.com/2008/08/04/google-docs-now-has-templates-for-google-apps.html</link>
		<comments>http://www.x2od.com/2008/08/04/google-docs-now-has-templates-for-google-apps.html#comments</comments>
		<pubDate>Mon, 04 Aug 2008 22:07:00 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[SFDC for Google Apps]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[Eclipse IDE]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<category><![CDATA[Salesforce for Google Apps]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=114</guid>
		<description><![CDATA[Google Docs has templates, and those of us using Google Apps with our Salesforce org (which should be almost everyone, since it’s free and easy to use) can design company-wide templates. This, combined with Google Docs’ super collaborative features, should make things much easier for consultants.]]></description>
			<content:encoded><![CDATA[<p>I use templates for most of my documentation&#8211;it&#8217;s just easier to write a ROF or a configuration plan when all the standard information is already there.  Up to this point, short of using <a href="http://www.salesforce.com/products/content-management/">Salesforce Content</a> or <a href="http://www.dreamfactory.com/solutions/dreamteam">DreamTeam</a>, I haven&#8217;t seen many options for version control through Salesforce.  Until now.</p>
<p><a href="http://docs.google.com">Google Docs</a> has <a href="http://www.google.com/google-d-s/whatsnew.html">templates</a>, and those of us using <a href="http://www.google.com/a/help/intl/en/index.html">Google Apps</a> with our Salesforce org (which should be almost everyone, since it&#8217;s free and easy to use) can <a href="http://documents.google.com/support/bin/answer.py?answer=99065&#038;hl=en">design company-wide templates</a>.  This, combined with Google Docs&#8217; super collaborative features, should make things much easier for consultants.</p>
<p>Here&#8217;s my wishlist for this feature: Use the <a href="http://wiki.apexdevnet.com/index.php/Google_Data_API_Toolkit">Google-Salesforce Toolkit</a> to create a spreadsheet with each worksheet representing an object and each row a field.  (It would probably use a Describe function, etc.)  Include columns for things like label, name, length, type, picklist values, etc.  I don&#8217;t know how to code it myself, but it would be awesome to use.  If we had one for a fresh, pristine org as a template, then we could use that for requirements-gathering with clients, creating the template in Google Docs and then doing the configuration based upon that spreadsheet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2008/08/04/google-docs-now-has-templates-for-google-apps.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Activities Tab in Salesforce</title>
		<link>http://www.x2od.com/2008/08/03/activities-tab-in-salesforce.html</link>
		<comments>http://www.x2od.com/2008/08/03/activities-tab-in-salesforce.html#comments</comments>
		<pubDate>Mon, 04 Aug 2008 03:03:58 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<category><![CDATA[Salesforce.com]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=105</guid>
		<description><![CDATA[To display a tab of Activities, just like you can with Accounts, Opportunities, etc., use the following URLs in the Web Tab configuration screen: /home/actlist.jsp?isdtp=mn Displays a full-page list of Activities (Tasks and Events) The list is non-enhanced, even when viewed in an &#8220;enhanced lists&#8221; org. /home/actlist.jsp Displays Activities with the Sidebar and Tabs these [...]]]></description>
			<content:encoded><![CDATA[<p>To display a tab of Activities, just like you can with Accounts, Opportunities, etc., use the following URLs in the Web Tab configuration screen:</p>
<p><strong>/home/actlist.jsp?isdtp=mn</strong></p>
<ul>
<li>Displays a full-page list of Activities (Tasks and Events)</li>
<li>The list is non-enhanced, even when viewed in an &#8220;enhanced lists&#8221; org.</li>
</ul>
<p><strong>/home/actlist.jsp</strong></p>
<ul>
<li>Displays Activities with the Sidebar and Tabs</li>
</ul>
<p>these are especially useful if you have Enhanced Lists enabled &#8211; it looks amazing.  Create additional views for Tasks or Events, and then save the URL for each as its own Web Tab as desired.<br />
(For example, in my org, My Open Tasks is https://na1.salesforce.com/007?fcf=00B30000005UoEi &#8211; I made a Web Tab and in the URL put &#8220;/007?fcf=00B30000005UoEi.&#8221;  Worked perfectly.</p>
<p>Enjoy!</p>
<p><strong>Addendum:</strong> To prevent multiple rows of tabs at the top of the page, you can launch the tab from a link.  The best way to do this is to put a custom link in your sidebar and to view the tab that way.  </p>
<p><strong>Addendum 2:</strong>  Kudos to Andres G for noting that the ?idtsp=mn version looks like the Salesforce Console&#8211;it absolutely does!  There was a discussion on the developer boards.</p>
<p>Also, <a href="http://www.arrowpointe.com">Scott Hemmeter</a> <a href="http://sfdc.arrowpointe.com/2006/05/12/open-custom-links-in-the-same-window-without-creating-nested-frames/">blogged </a>about this a while back and included some javascript to get around the double-tabs problem.</p>
<p>My next <a href="http://wiki.apexdevnet.com/index.php/Visualforce">Visualforce </a>coding project will be to create this using VF, likely based on <a href="http://wiki.apexdevnet.com/index.php/Account_recordType">Ron Hess&#8217; code example</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2008/08/03/activities-tab-in-salesforce.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress, Akismet, and Web-to-Salesforce</title>
		<link>http://www.x2od.com/2008/07/02/wordpress-akismet-and-web-to-salesforce.html</link>
		<comments>http://www.x2od.com/2008/07/02/wordpress-akismet-and-web-to-salesforce.html#comments</comments>
		<pubDate>Thu, 03 Jul 2008 03:47:50 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[Akismet]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web-to]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=33</guid>
		<description><![CDATA[Scott Hemmeter posted a blog entry about using Akismet and PHP to check Web-to-Lead submissions for spam.  We are going to start an experiment using Akismet in the following scenarios:
-Web-to-Lead with Google AdWords enabled
-Web-to-Case]]></description>
			<content:encoded><![CDATA[<p>We use WordPress to run our blog, which we host on a shared server, and we use Akismet to check comments for spam (though the only comments I&#8217;ve seen on this blog have been my test comments).</p>
<p><a href="http://www.arrowpointe.com">Scott Hemmeter</a> posted a blog entry about using Akismet and PHP to check Web-to-Lead submissions for spam.  We are going to start an experiment using Akismet in the following scenarios:</p>
<ul>
<li>Web-to-Lead with Google AdWords enabled</li>
<li>Web-to-Case</li>
</ul>
<p>Sound good?  We&#8217;ll keep everyone up to speed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2008/07/02/wordpress-akismet-and-web-to-salesforce.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AppExchange Makeover</title>
		<link>http://www.x2od.com/2008/07/02/appexchange-makeover.html</link>
		<comments>http://www.x2od.com/2008/07/02/appexchange-makeover.html#comments</comments>
		<pubDate>Thu, 03 Jul 2008 00:25:50 +0000</pubDate>
		<dc:creator>David Schach</dc:creator>
				<category><![CDATA[Native Application]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[salesforce.com]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<category><![CDATA[Salesforce.com]]></category>

		<guid isPermaLink="false">http://www.x2od.com/?p=28</guid>
		<description><![CDATA[Looks like Salesforce has changed its user-interface again.  Remember the Apps menu with the AppExchange link that opened the AppExchange in a new tab?  That's been changed.]]></description>
			<content:encoded><![CDATA[<p>Looks like Salesforce has changed its user-interface again.  Remember the Apps menu with the AppExchange link that opened the AppExchange in a new tab?  That&#8217;s been changed.<br />
<!--start_raw--><br />
<strong>OLD:</strong><br />
<br /></p>
<p><img src="http://www.x2od.com/wp/uploads/before.png" alt="Salesforce Old AppExchange Logo" title="AppExchange Logo Before"><BR CLEAR=LEFT><br />
AppExchange Logo and Apps menu with &#8220;Add Apps&#8230;&#8221; at the bottom of the menu</p>
<p><strong>NEW:</strong><br />
<br /><br />
<img src="http://www.x2od.com/wp/uploads/after.jpg" alt="Salesforce New AppExchange Image" title="New AppExchange Image"><BR CLEAR=LEFT><br />
force.com Apps Logo and Apps menu with
<ul>
<li>a space </li>
<li>Add AppExchange Apps</li>
<li>Create New Apps</li>
</ul>
<p>
The last item, Create New Apps, takes you to developer.force.com.  </p>
<p>
Salesforce is clearly pushing the Platform, encouraging people to create their own apps.  Looks like I&#8217;m going to spend the next few days going through every tutorial I can find, starting with how to code in Java.  I&#8217;m heading to Sydney, Australia on Friday, so I&#8217;ll have plenty of reading to do on the plane.  Problem is this: 4 hours of batteries on a 12 hour flight doesn&#8217;t really help much, does it?  Oh well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x2od.com/2008/07/02/appexchange-makeover.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
