<?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</title>
	<atom:link href="https://www.x2od.com/feed" rel="self" type="application/rss+xml" />
	<link>https://www.x2od.com/</link>
	<description>Salesforce solutions delivered</description>
	<lastBuildDate>Wed, 03 Jan 2024 18:00:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/FinalLogo_SquareCanvas-5494eea4v1_site_icon.png?fit=32%2C32&#038;ssl=1</url>
	<title>X-Squared On Demand</title>
	<link>https://www.x2od.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">24581929</site>	<item>
		<title>Prevent Duplicate Emails on Leads</title>
		<link>https://www.x2od.com/2024/prevent-duplicate-lead-emails</link>
					<comments>https://www.x2od.com/2024/prevent-duplicate-lead-emails#respond</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Wed, 03 Jan 2024 17:10:18 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Salesforce CRM]]></category>
		<guid isPermaLink="false">https://www.x2od.com/?p=4484</guid>

					<description><![CDATA[<p>Because the original Salesforce Cookbooks are no longer available online, I&#8217;m putting this code here so other people can benefit from it. I&#8217;m pulling (and cleaning up a bit) from the 2010 Cookbook. Discover an effective solution for preventing duplicate leads in Salesforce with this comprehensive Apex code cookbook. Because the original Salesforce Cookbooks are [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2024/prevent-duplicate-lead-emails">Prevent Duplicate Emails on Leads</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Because the original Salesforce Cookbooks are no longer available online, I&#8217;m putting this code here so other people can benefit from it. I&#8217;m pulling (and cleaning up a bit) from the 2010 Cookbook.</p>



<p>Discover an effective solution for preventing duplicate leads in Salesforce with this comprehensive Apex code cookbook. Because the original Salesforce Cookbooks are no longer available online, this resource offers valuable code snippets to address the challenge of ensuring uniqueness based on the value of a standard field. The provided Apex trigger, designed for both before insert and before update events, efficiently utilizes a map to identify and handle duplicate leads. The included class for testing ensures the trigger&#8217;s robustness in handling single and bulk-record inserts and updates.</p>



<p>(BEGIN QUOTE)</p>



<p>If you need to require uniqueness based on the value of two or more fields, or a single standard field, write an Apex before insert and before update trigger. For example, the following trigger prevents leads from being saved if they have a matching Email field:</p>



<ul class="wp-block-list">
<li>The trigger first uses a map to store the updated leads with each lead&#8217;s email address as the key.</li>



<li>The trigger then uses the set of keys in the map to query the database for any existing lead records with the same email addresses. For every matching lead, the duplicate record is marked with an error condition.</li>
</ul>



<pre class="wp-block-code has-small-font-size"><code>trigger leadDuplicatePreventer on Lead(before insert, before update) {
  Map&lt;String, Lead> leadMap = new Map&lt;String, Lead>();
  for (Lead lead : Trigger.new) {
    // Make sure we don't treat an email address that
    // isn't changing during an update as a duplicate.
    if ((lead.Email != null) &amp;&amp; (Trigger.isInsert || (lead.Email != Trigger.oldMap.get(lead.Id).Email))) {
      // Make sure another new lead isn't also a duplicate
      if (leadMap.containsKey(lead.Email)) {
        lead.Email.addError('Another new lead has the ' + 'same email address.');
      } else {
        leadMap.put(lead.Email, lead);
      }
    }
  }
  // Using a single database query, find all the leads in
  // the database that have the same email address as any
  // of the leads being inserted or updated.
  for (Lead lead : &#91;SELECT Email FROM Lead WHERE Email IN :leadMap.KeySet()]) {
    Lead newLead = leadMap.get(lead.Email);
    newLead.Email.addError('A lead with this email ' + 'address already exists.');
  }
}</code></pre>



<p>The following class can be used to test the trigger for both single- and bulk-record inserts and updates.</p>



<pre class="wp-block-code has-small-font-size"><code>@isTest
public class LeadDupePreventerTests {
  @isTest
  private static void testLeadDupPreventer() {
    // First make sure there are no leads already in the system
    // that have the email addresses used for testing
    Set&lt;String> testEmailAddress = new Set&lt;String>();
    testEmailAddress.add('test1@duptest.com');
    testEmailAddress.add('test2@duptest.com');
    testEmailAddress.add('test3@duptest.com');
    testEmailAddress.add('test4@duptest.com');
    testEmailAddress.add('test5@duptest.com');
    Assert.areEqual(0,
      &#91;SELECT COUNT()
        FROM Lead
        WHERE Email IN :testEmailAddress]);
    // Seed the database with some leads, and make sure they can
    // be bulk inserted successfully.
    Lead lead1 = new Lead(LastName = 'Test1', Company = 'Test1 Inc.', Email = 'test1@duptest.com');
    Lead lead2 = new Lead(LastName = 'Test2', Company = 'Test2 Inc.', Email = 'test4@duptest.com');
    Lead lead3 = new Lead(LastName = 'Test3', Company = 'Test3 Inc.', Email = 'test5@duptest.com');
    Lead&#91;] leads = new List&lt;Lead>{ lead1, lead2, lead3 };
    insert leads;
    // Now make sure that some of these leads can be changed and
    // then bulk updated successfully. Note that lead1 is not
    // being changed, but is still being passed to the update
    // call. This should be OK.
    lead2.Email = 'test2@duptest.com';
    lead3.Email = 'test3@duptest.com';
    update leads;
    // Make sure that single row lead duplication prevention works
    // on insert.
    Lead dup1 = new Lead(LastName = 'Test1Dup', Company = 'Test1Dup Inc.', Email = 'test1@duptest.com');
    try {
      insert dup1;
      Assert.isTrue(false);
    } catch (DmlException e) {
      Assert.isTrue(e.getNumDml() == 1);
      Assert.isTrue(e.getDmlIndex(0) == 0);
      Assert.isTrue(e.getDmlFields(0).size() == 1);
      Assert.isTrue(e.getDmlFields(0)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(0).indexOf('A lead with this email address already exists.') > -1);
    }
    // Make sure that single row lead duplication prevention works
    // on update.
    dup1 = new Lead(Id = lead1.Id, LastName = 'Test1Dup', Company = 'Test1Dup Inc.', Email = 'test2@duptest.com');
    try {
      update dup1;
      Assert.isTrue(false);
    } catch (DmlException e) {
      Assert.isTrue(e.getNumDml() == 1);
      Assert.isTrue(e.getDmlIndex(0) == 0);
      Assert.isTrue(e.getDmlFields(0).size() == 1);
      Assert.isTrue(e.getDmlFields(0)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(0).indexOf('A lead with this email address already exists.') > -1);
    }
    // Make sure that bulk lead duplication prevention works on
    // insert. Note that the first item being inserted is fine,
    // but the second and third items are duplicates. Note also
    // that since at least one record insert fails, the entire
    // transaction will be rolled back.
    dup1 = new Lead(LastName = 'Test1Dup', Company = 'Test1Dup Inc.', Email = 'test4@duptest.com');
    Lead dup2 = new Lead(LastName = 'Test2Dup', Company = 'Test2Dup Inc.', Email = 'test2@duptest.com');
    Lead dup3 = new Lead(LastName = 'Test3Dup', Company = 'Test3Dup Inc.', Email = 'test3@duptest.com');
    Lead&#91;] dups = new List&lt;Lead>{ dup1, dup2, dup3 };
    try {
      insert dups;
      Assert.isTrue(false);
    } catch (DmlException e) {
      Assert.isTrue(e.getNumDml() == 2);
      Assert.isTrue(e.getDmlIndex(0) == 1);
      Assert.isTrue(e.getDmlFields(0).size() == 1);
      Assert.isTrue(e.getDmlFields(0)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(0).indexOf('A lead with this email address already exists.') > -1);
      Assert.isTrue(e.getDmlIndex(1) == 2);
      Assert.isTrue(e.getDmlFields(1).size() == 1);
      Assert.isTrue(e.getDmlFields(1)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(1).indexOf('A lead with this email address already exists.') > -1);
    }
    // Make sure that bulk lead duplication prevention works on
    // update. Note that the first item being updated is fine,
    // because the email address is new, and the second item is
    // also fine, but in this case it's because the email
    // address doesn't change. The third case is flagged as an
    // error because it is a duplicate of the email address of the
    // first lead's value in the database, even though that value
    // is changing in this same update call. It would be an
    // interesting exercise to rewrite the trigger to allow this
    // case. Note also that since at least one record update
    // fails, the entire transaction will be rolled back.
    dup1 = new Lead(Id = lead1.Id, Email = 'test4@duptest.com');
    dup2 = new Lead(Id = lead2.Id, Email = 'test2@duptest.com');
    dup3 = new Lead(Id = lead3.Id, Email = 'test1@duptest.com');
    dups = new List&lt;Lead>{ dup1, dup2, dup3 };
    try {
      update dups;
      Assert.isTrue(false);
    } catch (DmlException e) {
      System.debug(e.getNumDml());
      System.debug(e.getDmlMessage(0));
      Assert.isTrue(e.getNumDml() == 1);
      Assert.isTrue(e.getDmlIndex(0) == 2);
      Assert.isTrue(e.getDmlFields(0).size() == 1);
      Assert.isTrue(e.getDmlFields(0)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(0).indexOf('A lead with this email address already exists.') > -1);
    }
    // Make sure that duplicates in the submission are caught when
    // inserting leads. Note that this test also catches an
    // attempt to insert a lead where there is an existing
    // duplicate.
    dup1 = new Lead(LastName = 'Test1Dup', Company = 'Test1Dup Inc.', Email = 'test4@duptest.com');
    dup2 = new Lead(LastName = 'Test2Dup', Company = 'Test2Dup Inc.', Email = 'test4@duptest.com');
    dup3 = new Lead(LastName = 'Test3Dup', Company = 'Test3Dup Inc.', Email = 'test3@duptest.com');
    dups = new List&lt;Lead>{ dup1, dup2, dup3 };
    try {
      insert dups;
      Assert.isTrue(false);
    } catch (DmlException e) {
      Assert.isTrue(e.getNumDml() == 2);
      Assert.isTrue(e.getDmlIndex(0) == 1);
      Assert.isTrue(e.getDmlFields(0).size() == 1);
      Assert.isTrue(e.getDmlFields(0)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(0).indexOf('Another new lead has the same email address.') > -1);
      Assert.isTrue(e.getDmlIndex(1) == 2);
      Assert.isTrue(e.getDmlFields(1).size() == 1);
      Assert.isTrue(e.getDmlFields(1)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(1).indexOf('A lead with this email address already exists.') > -1);
    }
    // Make sure that duplicates in the submission are caught when
    // updating leads. Note that this test also catches an attempt
    // to update a lead where there is an existing duplicate.
    dup1 = new Lead(Id = lead1.Id, Email = 'test4@duptest.com');
    dup2 = new Lead(Id = lead2.Id, Email = 'test4@duptest.com');
    dup3 = new Lead(Id = lead3.Id, Email = 'test2@duptest.com');
    dups = new List&lt;Lead>{ dup1, dup2, dup3 };
    try {
      update dups;
      Assert.isTrue(false);
    } catch (DmlException e) {
      Assert.isTrue(e.getNumDml() == 2);
      Assert.isTrue(e.getDmlIndex(0) == 1);
      Assert.isTrue(e.getDmlFields(0).size() == 1);
      Assert.isTrue(e.getDmlFields(0)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(0).indexOf('Another new lead has the same email address.') > -1);
      Assert.isTrue(e.getDmlIndex(1) == 2);
      Assert.isTrue(e.getDmlFields(1).size() == 1);
      Assert.isTrue(e.getDmlFields(1)&#91;0] == 'Email');
      Assert.isTrue(e.getDmlMessage(1).indexOf('A lead with this email address already exists.') > -1);
    }
  }
}</code></pre>



<p><strong>Discussion</strong></p>



<p>The first and most important lesson to learn from this recipe is that you should generally take advantage of point-and-click Force.com functionality if it can solve your problem, rather than writing code. By using the point-and-click tools that are provided, you leverage the power of the platform. Why reinvent the wheel if you can take advantage of a point-and-click feature that performs the same functionality? As a result, we indicate in this recipe that you should first determine whether you can simply use the Unique and Required checkboxes on a single custom field definition to prevent duplicates.</p>



<p>If you do need to check for duplicates based on the value of a single standard field, or more than one field, Apex is the best way to accomplish this. Because Apex runs on the Force.com servers, it&#8217;s far more efficient than a deduplication algorithm that runs in a Web control. Additionally, Apex can execute every time a record is inserted or updated in the database, regardless of whether the database operation occurs as a result of a user clicking <strong>Save </strong>in the user interface, or as a result of a bulk upsert call to the API. Web controls can only be triggered when a record is saved through the user interface.</p>



<p>The included trigger is production-ready because it meets the following criteria:</p>



<ul class="wp-block-list">
<li>The trigger only makes a single database query, regardless of the number of leads being inserted or updated.</li>



<li>The trigger catches duplicates that are in the list of leads being inserted or updated.</li>



<li>The trigger handles updates properly. That is, leads that are being updated with email addresses that haven&#8217;t changed are not flagged as duplicates.</li>



<li>The trigger has full unit test coverage, including tests for both single- and bulk-record inserts and updates.</li>
</ul>



<p>(END QUOTE)</p>



<p>Note that this only handles Leads. The Cookbook doesn&#8217;t check against Contacts.</p>



<p>Also, I know the trigger has logic &#8211; this is taken from the Cookbook! Update it to work with your trigger handler framework (you DO use one, right?).</p>



<p>Whether you&#8217;re a Salesforce developer seeking a reliable duplicate prevention strategy or an administrator looking to enhance data quality, this resource provides a practical and production-ready solution. Take advantage of this Salesforce Apex code cookbook to efficiently manage duplicate leads and elevate the performance of your Salesforce instance.</p>
<p>The post <a href="https://www.x2od.com/2024/prevent-duplicate-lead-emails">Prevent Duplicate Emails on Leads</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2024/prevent-duplicate-lead-emails/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4484</post-id>	</item>
		<item>
		<title>Duplicate Record Item Enrichment and Auto-Deletion Code</title>
		<link>https://www.x2od.com/2022/duplicate-record-items</link>
					<comments>https://www.x2od.com/2022/duplicate-record-items#respond</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Mon, 28 Feb 2022 23:14:29 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Salesforce CRM]]></category>
		<guid isPermaLink="false">https://www.x2od.com/?p=4398</guid>

					<description><![CDATA[<p>TL;DR: Check out code to enrich DuplicateRecordItem records and to handle extra DuplicateRecordSet records after merging duplicates at https://github.com/dschach/duplicatehandling I love the standard Salesforce duplicate records feature (Trailhead: https://trailhead.salesforce.com/content/learn/modules/sales_admin_duplicate_management H&#38;T: https://help.salesforce.com/s/articleView?id=sf.managing_duplicates_overview.htm) and have used it extensively, both to prevent duplicates and to track/report on duplicates for later management. If your org is set to allow [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2022/duplicate-record-items">Duplicate Record Item Enrichment and Auto-Deletion Code</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>TL;DR: Check out code to enrich DuplicateRecordItem records and to handle extra DuplicateRecordSet records after merging duplicates at <a href="https://github.com/dschach/duplicatehandling" target="_blank" rel="noreferrer noopener">https://github.com/dschach/duplicatehandling</a></p>



<p>I love the standard Salesforce duplicate records feature (Trailhead: <a href="https://trailhead.salesforce.com/content/learn/modules/sales_admin_duplicate_management" target="_blank" rel="noreferrer noopener">https://trailhead.salesforce.com/content/learn/modules/sales_admin_duplicate_management</a> H&amp;T: <a href="https://help.salesforce.com/s/articleView?id=sf.managing_duplicates_overview.htm" target="_blank" rel="noreferrer noopener">https://help.salesforce.com/s/articleView?id=sf.managing_duplicates_overview.htm</a>) and have used it extensively, both to prevent duplicates and to track/report on duplicates for later management.</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="550" height="370" data-attachment-id="4406" data-permalink="https://www.x2od.com/2022/duplicate-record-items/duplicatecontactimage" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?fit=953%2C641&amp;ssl=1" data-orig-size="953,641" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="DuplicateContactImage" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?fit=300%2C202&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?fit=550%2C370&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?resize=550%2C370&#038;ssl=1" alt="" class="wp-image-4406" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?resize=550%2C370&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?resize=300%2C202&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?resize=150%2C101&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?resize=768%2C517&amp;ssl=1 768w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/DuplicateContactImage.png?w=953&amp;ssl=1 953w" sizes="(max-width: 550px) 100vw, 550px" /><figcaption>Image from Trailhead</figcaption></figure>



<p>If your org is set to allow duplicates to be created and to report on them, then you&#8217;ve probably gone to the Duplicate Record Set tab and looked at the sets there, used a report to see all the sets, or clicked on the &#8220;Possible Duplicates&#8221; component on a record page. </p>



<p class="has-medium-font-size"><strong>Reporting &amp; Duplicate Record Item Enrichment</strong></p>



<p>Unfortunately, reporting on Duplicate Record Items is difficult because it doesn&#8217;t show enough detail about the duplicates themselves. If you want to group by any attribute other than the record name or Duplicate Rule, you&#8217;re out of luck. Wouldn&#8217;t it be nice to have some code to enrich your Duplicate Record Item object to include a proper lookup to the records so you can make custom report types to include, say, the Record Type or the Contact Email? </p>



<p>I&#8217;ve created an <a href="https://github.com/dschach/duplicatehandling#readme" target="_blank" rel="noreferrer noopener">easily-installable bit of Apex</a> that you can put into your sandbox and promote to Production, and you can give it a test-run in a scratch org if you&#8217;d like.</p>



<p class="has-medium-font-size"><strong>Unnecessary Duplicate Record Set Auto-Deletion</strong></p>



<p>Once you&#8217;ve chosen to merge those duplicates, then good job! You&#8217;ve removed some clutter from, say, the Contact object&#8230; but you may inadvertently have left some clutter on the Duplicate Record Set and Duplicate Record Item object!</p>



<p>Though you started with one DR Set and two DR Items, and you merged the two Contacts, Salesforce doesn&#8217;t clean up the no-longer-needed Set/Item combo. So I wrote some code that removes that single, lonely, unnecessary set. After all, you&#8217;ve done a good job, so why shouldn&#8217;t you be rewarded with the removal of that reminder of once-dirty data? This code fixes that!</p>



<p>Head over to <a href="https://github.com/dschach/duplicatehandling">https://github.com/dschach/duplicatehandling</a> and give it a whirl! Instructions are in the README, and full code documentation is at <a href="https://dschach.github.io/duplicatehandling/" target="_blank" rel="noreferrer noopener">https://dschach.github.io/duplicatehandling/</a>.</p>
<p>The post <a href="https://www.x2od.com/2022/duplicate-record-items">Duplicate Record Item Enrichment and Auto-Deletion Code</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2022/duplicate-record-items/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4398</post-id>	</item>
		<item>
		<title>Lightning Component With Running User Information</title>
		<link>https://www.x2od.com/2015/lightning-component-running-user</link>
					<comments>https://www.x2od.com/2015/lightning-component-running-user#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Fri, 27 Feb 2015 21:07:00 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Lightning]]></category>
		<category><![CDATA[Lightning Components]]></category>
		<category><![CDATA[Lightning Platform]]></category>
		<category><![CDATA[Salesforce CRM]]></category>
		<category><![CDATA[AppBuilder]]></category>
		<category><![CDATA[Salesforce1]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=4255</guid>

					<description><![CDATA[<p>Last week, at Snowforce in Salt Lake City, I saw a demonstration of the Lightning App Builder and decided that I wanted to make a Lightning component of my own. I thought the best thing to do was to follow the quick-start PDF, and was quite proud of that. I made the text say "Hello [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2015/lightning-component-running-user">Lightning Component With Running User Information</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[Last week, at Snowforce in Salt Lake City, I saw a demonstration of the Lightning App Builder and decided that I wanted to make a Lightning component of my own. I thought the best thing to do was to follow the <a title="Lightning Quick Start" href="https://developer.salesforce.com/resource/pdfs/Lightning_QuickStart.pdf" target="_blank" rel="noopener noreferrer">quick-start PDF</a>, and was quite proud of that. I made the text say "Hello David!" which seemed like a good start.

<a title="Button Click Admin" href="http://www.buttonclickadmin.com" target="_blank" rel="noopener noreferrer">Mike Gerholdt</a> then challenged me to render the word "David" dynamically, pulling from the running user. I checked the documentation, and there is no <b>$User</b> global variable as there is in Visualforce, so I was faced with a conundrum: How to pull fields from the current User record? The documentation and quick-start expenses app show how to pull a list of records and then to choose one from those, but I wanted something different.

After perusing <a title="Salesforce Lightning Component Newbie Notes" href="http://reidcarlberg.github.io/lightning-newbie/" target="_blank" rel="noopener noreferrer">Reid Carlberg's post</a> about Lightning components, I had my answer. I won't explain too much what is going on here, but I will share the necessary parts of the app.

I have endeavored to make all the method and variable names different enough so you can see where each comes from. If there is any confusion, please leave a comment and I will update the post accordingly.

<strong>ExampleApp - Lightning Application</strong>

This is only necessary for previewing your work in a browser window. As we will see, it is unnecessary for creating components for either the Salesforce1 mobile interface or the Lightning App Builder interface.
<pre class="lang:html" decode:false"=""><aura:application>
    <c:toplevelcomponent></c:toplevelcomponent>
</aura:application>
</pre>
<strong>TopLevelUserComponent - Lightning Component</strong>

This is perhaps the most important part, as it is a container for all the other components that will contain whatever we want to put in our application. This contains the required code for exposing the component to Salesforce1 (<b>force:appHostable</b>) and to the Lightning App Builder (<b>flexipage:availableForAllPageTypes</b>). If we put any code or styling here, it would be available, should we wish, to all child components. This is how components communicate with each other if they are not above or below in the component hierarchy.

This is also important because apps will likely have multiple components all at the same hierarchy level, so the "top level" container allows us to unify everything in one place.
<pre class="lang:html" decode:false"=""><aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
    

<h1>Hello TopLevelUserComponent!</h1>


    <c:userfromuser></c:userfromuser>
</aura:component>
</pre>
<strong>UserFromUser - Lightning Component</strong>

Here is where things get interesting. The component is fairly simple, with an Apex controller to allow us to pull data from the Salesforce database, an attribute for the running User, a line to run the code to query the data, and an output of that data.
<pre class="lang:html" decode:false"=""><aura:component controller="CurrentUserController">
    

<h1>User from User Component</h1>


    <aura:attribute name="runningUser" type="User"></aura:attribute>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"></aura:handler>

User lastname: <ui:outputtext value="{!v.runningUser.LastName}"></ui:outputtext> {!v.runningUser.LastName} <aura:text value="{!v.runningUser.LastName}"></aura:text>

User firstname: <ui:outputtext value="{!v.runningUser.FirstName}"></ui:outputtext> {!v.runningUser.FirstName} <aura:text value="{!v.runningUser.FirstName}"></aura:text>

</aura:component>
</pre>
Please note that I have written the first and last names thrice: Once with a <b>ui:outputText</b> tag, once as naked markup, and once with an <b>aura:text</b> tag. I have no idea which is the best practice, but as I try never to put naked text on a Visualforce tag, I will assume that either <b>ui:outputText</b> or <b>aura:text</b> are best.

<strong>UserFromUser - Component JavaScript Controller</strong>

This JavaScript class (I'm not sure if class is the right word, but it will have to do for now) contains the run-once code for this component. If we had code that would be run repeatedly, it would be better to put that into the Helper class. Because we have none, I did not put anything in the helper.
<pre class="lang:js" decode:false"="">({
    doInit: function(component, event, helper) {
        var action = component.get("c.getCurrentUser"); // method in the apex class
        action.setCallback(this, function(a) {
            component.set("v.runningUser", a.getReturnValue()); // variable in the component
        });
        $A.enqueueAction(action);
    }
})
</pre>
This shows the standard base-code that I plan to use for my components: Much as there is an <b>action</b> tag in the <b>apex:page</b> Visualforce component, which calls an Apex method, here I use the <b>c.doInit</b> action, which is prefaced by c to show that it is called in a controller (and as we will see below, that refers here to the JavaScript controller, whereas in JavaScript it refers to the Apex controller).

<strong>CurrentUserController - Apex Controller</strong>

This Apex class allows us to query the database. Note that the method is static and has the <b>@auraenabled</b> annotation, allowing it to be seen by the JavaScript controller.

I have kept the code simple; were I to do this for an ISV, I might describe the User sObject and then included all available fields in my query. Here, though, I just wanted first and last names.
<pre class="lang:java" decode:false"="">public class CurrentUserController {

    @AuraEnabled
    public static User getCurrentUser() {
    	User toReturn = [SELECT Id, FirstName, LastName FROM User WHERE Id = :UserInfo.getUserId() LIMIT 1];
        return toReturn;
    }
}
</pre>
The method <b>getCurrentUser</b> is called as <b>c.getCurrentUser</b> in the JavaScript. The c refers to controller, and to a different controller, depending on where it is used.

<strong>Style documents</strong>

I could have styled the h1 tag in any of the components I used, as well as the Application. While I don't think that styling in the Application is a good idea for any uses that I can imagine right now, I do think that care should be taken in choosing whether to style in the top-level component or a lower-level one. The Java developer in me thinks that much as we control access by declaring variables as finely as possible, we should handle styling in the same way. This is the CSS that I used. I put it in the UserFromUser Style document.
<pre class="lang:css" decode:false"="">.THIS h1 {
    font-size: 24px;
    padding-left: 40px;
}
</pre>
<strong>For more information</strong>
<ul>
 	<li><a href="https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/" target="_blank" rel="noopener noreferrer">Lightning Dev Guide</a></li>
 	<li><a href="https://developer.salesforce.com/trailhead/module/lightning_components" target="_blank" rel="noopener noreferrer">Trailhead Lightning Module</a></li>
 	<li><a href="https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_app_builder.htm" target="_blank" rel="noopener noreferrer">Configure Components for Lightning Pages and the Lightning App Builder</a></li>
 	<li><a title="Reid Carlberg" href="http://reidcarlberg.github.io/lightning-newbie/" target="_blank" rel="noopener noreferrer">Salesforce Lightning Component Newbie Notes</a></li>
 	<li><a href="http://blog.jeffdouglas.com/2014/10/14/tutorial-build-your-first-lightning-component/" target="_blank" rel="noopener noreferrer">Jeff Douglas: Building Your First Lightning Component</a></li>
</ul><p>The post <a href="https://www.x2od.com/2015/lightning-component-running-user">Lightning Component With Running User Information</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2015/lightning-component-running-user/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4255</post-id>	</item>
		<item>
		<title>ChatterBINGO is Now Open-Source</title>
		<link>https://www.x2od.com/2014/chatterbingo-github</link>
					<comments>https://www.x2od.com/2014/chatterbingo-github#respond</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Thu, 03 Jul 2014 17:00:55 +0000</pubDate>
				<category><![CDATA[Chatter]]></category>
		<category><![CDATA[Salesforce CRM]]></category>
		<category><![CDATA[Visualforce]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=4232</guid>

					<description><![CDATA[<p>At Dreamforce 2010, I had the honor of writing the only (to date) community-contributed app to the Dreamforce org: Chatter BINGO.<br />
It has been in an AppExchange listing for a while, in an unmanaged package, but I decided to open it up on GitHub to see if anyone wants to make updates/improvements.</p>
<p>The post <a href="https://www.x2od.com/2014/chatterbingo-github">ChatterBINGO is Now Open-Source</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1.png"><img data-recalc-dims="1" decoding="async" data-attachment-id="4236" data-permalink="https://www.x2od.com/2014/chatterbingo-github/cb-card-1" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1.png?fit=750%2C500&amp;ssl=1" data-orig-size="750,500" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="ChatterBINGO Card" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1.png?fit=300%2C200&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1.png?fit=550%2C366&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1-300x200.png?resize=300%2C200" alt="A sample ChatterBINGO card" width="300" height="200" class="alignright size-medium wp-image-4236" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1.png?resize=300%2C200&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1.png?resize=150%2C100&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1.png?resize=550%2C366&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/CB-Card-1.png?w=750&amp;ssl=1 750w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
At Dreamforce 2010, I had the honor of writing the only (to date) community-contributed app to the Dreamforce org: Chatter BINGO.</p>
<p>It has been in an <a title="ChatterBINGO on the Appexchange" href="https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003JfOwEAK" target="_blank">AppExchange listing</a> for a while, in an unmanaged package, but I decided to <a title="ChatterBINGO on GitHub" href="https://github.com/dschach/ChatterBINGO" target="_blank">open it up on GitHub</a> to see if anyone wants to make updates/improvements.</p>
<p>To quote <a title="Reid Carlberg Twitter" href="http://twitter.com/ReidCarlberg" target="_blank">Reid Carlberg&#8217;s</a> writing about the app:</p>
<blockquote><p><span class="feed-item-comment-text" style="color: #555555;"><span id="listingDetailPage:AppExchangeLayout:listingDetailForm:listingDetailReviewsTab:reviewsTabComponent:mostHelpfulNegative:reviewDetails:commentsList:0:commentShortDesc" class="feed-item-text-short-desc multi-line-to-fix">This app was actually a nice little add to DF10 &#8212; and it was completely community developed and helped new attendees connect with each other.</span></span></p></blockquote>
<p>The code isn&#8217;t pretty &#8211; it is pretty brute-force &#8211; but it gets the job done.</p>
<p>SEE THE PROJECT ON GITHUB: <a href="https://github.com/dschach/ChatterBINGO" title="ChatterBINGO on GitHub" target="_blank">https://github.com/dschach/ChatterBINGO</a></p>
<p>Feel free to contribute! (Anyone want to make a mobile-friendly or responsive version?)</p>
<p>The post <a href="https://www.x2od.com/2014/chatterbingo-github">ChatterBINGO is Now Open-Source</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2014/chatterbingo-github/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4232</post-id>	</item>
		<item>
		<title>Display Only My Role&#8217;s Records on a Report</title>
		<link>https://www.x2od.com/2013/my-role-records</link>
					<comments>https://www.x2od.com/2013/my-role-records#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Mon, 22 Jul 2013 15:25:45 +0000</pubDate>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Summer 13]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=4195</guid>

					<description><![CDATA[<p>Making a Salesforce Opportunity leaderboard is possible, but I&#8217;ve seen some cases where the standard filters don&#8217;t work well enough. It is easy enough to make a report that shows &#8220;My Accounts,&#8221; &#8220;My Opportunities,&#8221; and others. Let&#8217;s look at some of the standard options: According to the documentation, My Opportunities &#8211; Searches ONLY the opportunities you [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2013/my-role-records">Display Only My Role&#8217;s Records on a Report</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Making a Salesforce Opportunity leaderboard is possible, but I&#8217;ve seen some cases where the standard filters don&#8217;t work well enough. It is easy enough to make a report that shows &#8220;My Accounts,&#8221; &#8220;My Opportunities,&#8221; and others. Let&#8217;s look at some of the standard options:</p>
<p>According to the <a title="Opportunity Reports: Opportunity Team Selling" href="http://help.salesforce.com/apex/HTViewSolution?id=000005045&amp;language=en_US" target="_blank" rel="noopener">documentation</a>,</p>
<ul>
<li><strong>My Opportunities</strong> &#8211; Searches ONLY the opportunities you OWN.</li>
<li><strong>My Team-selling opportunities</strong> &#8211; Searches ONLY the opportunities where you are on the SALES TEAM.</li>
<li><strong>My Team-selling and my own Opportunities</strong> &#8211; Searches BOTH the opportunities you OWN and the opportunities where you are on the SALES TEAM.</li>
<li><strong>My Team&#8217;s Opportunities</strong> &#8211; Searches ONLY the opportunities OWNED by you and the users who report to you in the role hierarchy.</li>
<li><strong>My Team&#8217;s Team-selling and their Opportunities</strong> &#8211; Searches the opportunities OWNED by you and the users that report to you in the role hierarchy, as well as opportunities where you or the users who report to you in the role hierarchy are on the SALES TEAM.</li>
<li><strong>All Opportunities</strong> &#8211; Searches ALL visible opportunities.</li>
</ul>
<p>That&#8217;s great, but it doesn&#8217;t quite help for a common situation. <em>What if I have each sales team in a different role in the hierarchy and I want people to see only the Opportunities owned by users with that same role?</em> This often happens in companies that have a hierarchy that is geography-based and segment-based. So imagine something like this.</p>
<ul>
<li><span style="line-height: 13px;">VP Sales</span>
<ul>
<li>Director, Americas
<ul>
<li>SMB Team, Americas</li>
<li>Mid-Market Team, Americas</li>
<li>Enterprise Team, Americas</li>
</ul>
</li>
<li>Director, EMEA
<ul>
<li>SMB Team, EMEA</li>
<li>Mid-Market Team, EMEA</li>
<li>Enterprise Team, EMEA</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Summer 2013 has a new feature, a Checkbox Formula field. Just input an expression or an equation. If the expression yields 1 or true, or if the equation is, well, equal, then a checkbox appears on the page layout. In a data export, the field will say TRUE or FALSE. Simple! Let&#8217;s use this formula:</p>
<blockquote><p>Owner.UserRoleId = $UserRole.Id</p></blockquote>
<p>That&#8217;s it. Put that formula on the Opportunity object, and you&#8217;re done. Make a report with a filter to show only records where that field = TRUE, and the <em>dynamic dashboard</em> chart from that will show all Opportunities owned by other users in the running user&#8217;s role. Yes, that&#8217;s the catch: You must use a dynamic dashboard.</p>
<p>I&#8217;m sure you can imagine other uses for this such as a checkbox formula field on Contact: OwnerId = Account.OwnerId. And there are many more.</p>
<p>Checkbox formula fields &#8211; a little bit of awesome in Summer 13. What other uses can you think of?</p>
<p>The post <a href="https://www.x2od.com/2013/my-role-records">Display Only My Role&#8217;s Records on a Report</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2013/my-role-records/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4195</post-id>	</item>
		<item>
		<title>Chatter Publisher Actions (Part 2): Object Custom Action</title>
		<link>https://www.x2od.com/2013/publisher-actions-pt2</link>
					<comments>https://www.x2od.com/2013/publisher-actions-pt2#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Mon, 15 Jul 2013 16:30:37 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Chatter]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Summer 13]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Visualforce]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<category><![CDATA[Publisher]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=4114</guid>

					<description><![CDATA[<p>In the previous post, we looked at using the standard (button-click) way to create a new child record using Publisher Actions. Pretty basic stuff. Using Visualforce to create a custom action is a bit harder. Let's start with the documentation. The PDF provided by clicking on the link in the Actions screen (Account action is [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2013/publisher-actions-pt2">Chatter Publisher Actions (Part 2): Object Custom Action</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In the <a title="Chatter Publisher Actions (Part 1): Create a Record" href="http://www.x2od.com/2013/06/28/publisher-actions-pt1" target="_blank">previous pos</a>t, we looked at using the standard (button-click) way to create a new child record using Publisher Actions. Pretty basic stuff.</p>
<p>Using Visualforce to create a custom action is a bit harder. Let's start with the documentation.</p>
<ul>
<li>The PDF provided by clicking on the link in the Actions screen (<a title="Account Buttons, Links, and Actions" href="https://na15.salesforce.com/p/setup/link/ActionButtonLinkList?pageName=Account&amp;type=Account&amp;setupid=AccountLinks&amp;retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DAccount" target="_blank">Account action</a> is an example) has nothing about Visualforce.</li>
<li>Searching in the Help &amp; Training section yields a page <a title="Creating Visualforce Pages to Use as Custom Publisher Actions" href="http://help.salesforce.com/apex/HTViewHelpDoc?id=creating_vf_pages_for_custom_actions.htm&amp;language=en_US" target="_blank">Creating Visualforce Pages to Use as Custom Publisher Actions</a>, but I can't see where that page is found in the help tree on the left side of the page.</li>
<li>Interestingly, to find correct code (because the item above has a misprint) I had to go to Customizing Case Feed with Visualforce (<a title="Customizing Case Feed with Visualforce" href="http://www.salesforce.com/us/developer/docs/case_feed_dev/case_feed_dev_guide.pdf" target="_blank">PDF</a>).</li>
</ul>
<p>Let's set up our use-case and see what we can do with a Visualforce publisher.<br />
As before, we want to create a Task from a Case. The options when using the CaR publisher are, to review:</p>
<ol>
<li>Global action, which auto-fills zero fields</li>
<li>Case action, which auto-fills the "What" field but doesn't fill the "Who" field.</li>
</ol>
<p><div id="attachment_4116" style="width: 310px" class="wp-caption alignleft"><a href="http://www.x2od.com/2013/07/15/publisher-actions-pt2/screen-shot-2013-07-01-at-5-07-42-pm" rel="attachment wp-att-4116"><img data-recalc-dims="1" decoding="async" aria-describedby="caption-attachment-4116" data-attachment-id="4116" data-permalink="https://www.x2od.com/2013/publisher-actions-pt2/screen-shot-2013-07-01-at-5-07-42-pm" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?fit=550%2C435&amp;ssl=1" data-orig-size="550,435" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Standard Create a Task Publisher" data-image-description="" data-image-caption="&lt;p&gt;Note that the Contact is not filled. To fill *two* relationships, you will need a custom publisher and some Apex code.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?fit=300%2C237&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?fit=550%2C435&amp;ssl=1" class="size-medium wp-image-4116" alt="Standard Create a Task Publisher" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM-300x237.png?resize=300%2C237" width="300" height="237" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?resize=300%2C237&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?resize=150%2C118&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?w=550&amp;ssl=1 550w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-4116" class="wp-caption-text">Note that the Contact is not filled.</p></div></p>
<p><br clear="both" /><br />
We want to fill both the polymorphic lookup fields. We could insert default values for the other fields, but that can be done with the standard publisher and we'll see where default values can be determined in the code.<br />
First, we need a Visualforce page. There are differences between this one and the one in the Help &amp; Training area. Yes, that one creates a Case from an Account, but it also has some differences in its JavaScript. Check closely. Also, I changed the html somewhat so a little CSS would make things a bit nicer than the ugly bare div tags in the example.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;apex:page standardcontroller=&quot;Case&quot; extensions=&quot;CreateCaseTaskExtension&quot; showHeader=&quot;false&quot;&gt;
	&lt;script type='text/javascript' src='/canvas/sdk/js/28.0/publisher.js'/&gt;
	&lt;style&gt;
	    .requiredInput .requiredBlock, .requiredBlock {
	        background-color: white;
	    }
	    .custompubblock div {
	        display: inline-block;
	    }
	    .custompublabel {
	        width:100px;
	    }
	&lt;/style&gt;
	&lt;script&gt; function refreshFeed() {
		Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed: true}}); }
	&lt;/script&gt;
	&lt;apex:form &gt;
		&lt;apex:actionFunction action=&quot;{!createTask}&quot;
			name=&quot;createTask&quot;
			rerender=&quot;out&quot;
			oncomplete=&quot;refreshFeed();&quot;/&gt;
		&lt;apex:outputPanel id=&quot;out&quot; &gt;
			&lt;div class=&quot;custompubblock&quot;&gt;
				&lt;div class=&quot;custompublabel&quot;&gt;What:&lt;/div&gt;
				&lt;apex:inputField value=&quot;{!theTask.WhatId}&quot;
					style=&quot;margin-left:0;&quot;/&gt;&lt;br /&gt;
				&lt;div class=&quot;custompublabel&quot;&gt;Who:&lt;/div&gt;
				&lt;apex:inputField value=&quot;{!theTask.WhoId}&quot; /&gt;&lt;br /&gt;
				&lt;div class=&quot;custompublabel&quot;&gt;Subject:&lt;/div&gt;
				&lt;apex:inputField value=&quot;{!theTask.Subject}&quot; /&gt;&lt;br /&gt;
			&lt;/div&gt;
			&lt;div class=&quot;custompublabel&quot;&gt;Description:&lt;/div&gt;
			&lt;apex:inputField value=&quot;{!theTask.description}&quot;
				style=&quot;width:500px;
				height:92px;
				margin-top:4px;&quot; /&gt;&lt;br /&gt;
			&lt;div class=&quot;custompubblock&quot; style=&quot;margin-top:5px;&quot;&gt;
				&lt;div class=&quot;custompublabel&quot;&gt;Status:&lt;/div&gt;
				&lt;apex:inputField value=&quot;{!theTask.status}&quot; /&gt;&lt;br /&gt;
				&lt;div class=&quot;custompublabel&quot;&gt;Priority:&lt;/div&gt;
				&lt;apex:inputField value=&quot;{!theTask.priority}&quot; /&gt;&lt;br /&gt;
				&lt;div class=&quot;custompublabel&quot;&gt;Type:&lt;/div&gt;
				&lt;apex:inputField value=&quot;{!theTask.Type}&quot; /&gt;
			&lt;/div&gt;
			&lt;div style=&quot;color:red;&quot;&gt;{!lastError}&lt;/div&gt;
		&lt;/apex:outputPanel&gt;
	&lt;/apex:form&gt;
	&lt;br/&gt;
	&lt;button type=&quot;button&quot; onclick=&quot;createTask();&quot;
		style=&quot;position:fixed;
		bottom:0px;
		right:0px;
		padding:5px 10px;
		font-size:13px;
		font-weight:bold;
		line-height:18px;
		background-color:#0271BF;
		background-image:-moz-linear-gradient(#2DADDC, #0271BF);
		background-repeat:repeat-x;
		border-color:#096EB3;&quot;  id=&quot;addcasebutton&quot;&gt;
		Create Task
	&lt;/button&gt;
	&lt;apex:outputField value=&quot;{!case.ContactId}&quot; rendered=&quot;false&quot; /&gt;
&lt;/apex:page&gt;
</pre>
<p>And here's the controller extension:</p>
<pre class="brush: java; title: ; notranslate">
public with sharing class CreateCaseTaskExtension {
    private Case c;
    public CreateCaseTaskExtension(ApexPages.StandardController theController) {
        this.c = (Case)theController.getRecord();
        defineNewTask();
    }
    public Task theTask {get; set;}
    public String lastError {get; set;}
    public void defineNewTask(){
        theTask = new Task();
        theTask.WhatId = c.id;
        theTask.WhoId = c.ContactId;
        theTask.Priority = 'Normal';
        lastError = '';
    }
    public PageReference createTask() {
        createNewTask();
        defineNewTask();
        return null;
    }
    private void createNewTask() {
        try {
            insert theTask;
            FeedItem post = new FeedItem();
            post.ParentId = c.id;
            post.Body = 'created a task';
            post.type = 'LinkPost';
            post.LinkUrl = '/' + theTask.id;
            post.Title = theTask.Subject;
            insert post;
        } catch(System.Exception ex){
            system.debug('ERROR: ' + ex.getMessage());
            lastError = ex.getMessage();
        }
    }
}
</pre>
<p>Next, create a new Case Action and set the type to Custom Action:</p>
<p><div id="attachment_4180" style="width: 310px" class="wp-caption alignleft"><a href="http://www.x2od.com/2013/07/15/publisher-actions-pt2/edit-case-action" rel="attachment wp-att-4180"><img data-recalc-dims="1" loading="lazy" decoding="async" aria-describedby="caption-attachment-4180" data-attachment-id="4180" data-permalink="https://www.x2od.com/2013/publisher-actions-pt2/edit-case-action" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Edit-Case-Action.png?fit=513%2C443&amp;ssl=1" data-orig-size="513,443" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Edit Case Action" data-image-description="" data-image-caption="&lt;p&gt;Editing the Case Action &amp;#8211; specify a height for the frame and choose an icon (from a static resource) if desired.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Edit-Case-Action.png?fit=300%2C259&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Edit-Case-Action.png?fit=513%2C443&amp;ssl=1" class="size-medium wp-image-4180" alt="Editing the Case Action - specify a height for the frame and choose an icon (from a static resource) if desired." src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Edit-Case-Action-300x259.png?resize=300%2C259" width="300" height="259" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Edit-Case-Action.png?resize=300%2C259&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Edit-Case-Action.png?resize=150%2C129&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Edit-Case-Action.png?w=513&amp;ssl=1 513w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-4180" class="wp-caption-text">Editing the Case Action - specify a height for the frame and choose an icon (from a static resource) if desired.</p></div><br />
<br clear="both"/><br />
Only Visualforce pages using the Case standard controller are available here. The height of the frame must be specified (which will be a problem). The custom icon must be in a static resource; I haven't found anything about specifics/limits on those image files, but I don't see how those images can be put in a zip file, as the dialog box seems to say that the icons must each be an individual static resource.</p>
<p>This is the output:</p>
<p><div id="attachment_4178" style="width: 560px" class="wp-caption alignleft"><a href="http://www.x2od.com/2013/07/15/publisher-actions-pt2/visualforce-case-task-publisher" rel="attachment wp-att-4178"><img data-recalc-dims="1" loading="lazy" decoding="async" aria-describedby="caption-attachment-4178" data-attachment-id="4178" data-permalink="https://www.x2od.com/2013/publisher-actions-pt2/visualforce-case-task-publisher" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Visualforce-Case-Task-Publisher.png?fit=550%2C398&amp;ssl=1" data-orig-size="550,398" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Visualforce Case Task Publisher" data-image-description="" data-image-caption="&lt;p&gt;Note that the Case and the Contact are both filled. Also, note the cut-off picklist. The output from a custom publisher, even if it uses a standard controller and an extension, requires full CSS styling and a static height for the frame.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Visualforce-Case-Task-Publisher.png?fit=300%2C217&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Visualforce-Case-Task-Publisher.png?fit=550%2C398&amp;ssl=1" class="size-full wp-image-4178" alt="Note that the Case and the Contact are both filled. Also, note the cut-off picklist. The output from a custom publisher, even if it uses a standard controller and an extension, requires full CSS styling and a static height for the frame." src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Visualforce-Case-Task-Publisher.png?resize=550%2C398" width="550" height="398" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Visualforce-Case-Task-Publisher.png?w=550&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Visualforce-Case-Task-Publisher.png?resize=150%2C108&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Visualforce-Case-Task-Publisher.png?resize=300%2C217&amp;ssl=1 300w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a><p id="caption-attachment-4178" class="wp-caption-text">Note that the Case and the Contact are both filled. Also, note the cut-off picklist. The output from a custom publisher, even if it uses a standard controller and an extension, requires full CSS styling and a static height for the frame.</p></div><br />
<br clear="both"/><br />
That's it. These are some things I recommend when doing something like this:</p>
<ul>
<li>Make sure that you are using CSS because you don't have access to any standard stylesheets</li>
<li>Don't use dynamic rerendering unless you can guarantee that the page size won't change</li>
<li>Make one CSS static resource for every similar action in your org, to maintain a consistent look-and-feel</li>
<li>If you do try to use the standard styles that you can find when using standard CaR actions, be careful, as those may change without notice
<ol>Enjoy! What use-cases do you have for this feature? I can think of a few, including a custom record approval screen.</ol>
</li>
</ul>
<p>The post <a href="https://www.x2od.com/2013/publisher-actions-pt2">Chatter Publisher Actions (Part 2): Object Custom Action</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2013/publisher-actions-pt2/feed</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4114</post-id>	</item>
		<item>
		<title>Chatter Publisher Actions (Part 1): Create a Record</title>
		<link>https://www.x2od.com/2013/publisher-actions-pt1</link>
					<comments>https://www.x2od.com/2013/publisher-actions-pt1#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Fri, 28 Jun 2013 16:51:28 +0000</pubDate>
				<category><![CDATA[Chatter]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Summer 13]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=4112</guid>

					<description><![CDATA[<p>One of the most interesting &#8211; but least explained &#8211; features of Summer 13 (184) is Chatter Actions. There are three kinds of actions (Yes, you thought there were two, but there are more!) and after writing a few of each, here are some examples. The documentation is, as of this writing, both incomplete and [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2013/publisher-actions-pt1">Chatter Publisher Actions (Part 1): Create a Record</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.x2od.com/2013/07/15/publisher-actions-pt2/mdp-helpbanner-actions" rel="attachment wp-att-4117"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="4117" data-permalink="https://www.x2od.com/2013/publisher-actions-pt2/mdp-helpbanner-actions" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/mdp-helpbanner-actions.png?fit=225%2C175&amp;ssl=1" data-orig-size="225,175" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Chatter Multi-Dimensional Publisher Logo" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/mdp-helpbanner-actions.png?fit=225%2C175&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/mdp-helpbanner-actions.png?fit=225%2C175&amp;ssl=1" class="alignright size-full wp-image-4117" alt="Chatter Multi-Dimensional Publisher Logo" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/mdp-helpbanner-actions.png?resize=225%2C175" width="225" height="175" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/mdp-helpbanner-actions.png?w=225&amp;ssl=1 225w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/mdp-helpbanner-actions.png?resize=150%2C116&amp;ssl=1 150w" sizes="auto, (max-width: 225px) 100vw, 225px" /></a></p>
<p>One of the most interesting &#8211; but least explained &#8211; features of Summer 13 (184) is Chatter Actions. There are three kinds of actions (Yes, you thought there were two, but there are more!) and after writing a few of each, here are some examples. The documentation is, as of this writing, both incomplete and incorrect, so this should help a bit. I also found some gotchas when using Chatter actions in a specific setting.</p>
<p>Chatter Actions fall into two major categories: &#8220;Create a Record&#8221; and &#8220;Custom Action.&#8221; There are two locations for Chatter Actions: Object-specific and Global, meaning that Create actions and Custom actions can each be executed from a specific object Chatter publisher or can be created from the general publisher found on the Home and Chatter tabs.</p>
<p>To review:</p>
<ul>
<li>Create action
<ul>
<li>Global</li>
<li>Object-specific</li>
</ul>
</li>
<li>Custom action
<ul>
<li>Global</li>
<li>Object-specific</li>
</ul>
</li>
</ul>
<p>Clear, right? We could visualize it as first Object-specific, then Global, but that wouldn’t demonstrate the real differences and advantages/drawbacks.</p>
<p>This is the first of two blog posts. Today we&#8217;ll deal with &#8220;Create action” Publisher Actions.</p>
<p><strong>Global Create a Record Actions</strong></p>
<p>These are the most simple of any action. Select any object from the picklist (even ones that are not Chatter-enabled), name the action, and hit save. The icon matches the tab icon, unless there is no tab; for those, you will need to pick an icon you have uploaded as a static resource. There is no choosing from the existing tab icon set we have grown to know and love over the years.<br />
Next, edit the layout to show about 8 fields, and provide default values for picklists, text fields, etc. You cannot provide default values for lookups.</p>
<p>These records can be created from anywhere, including the Home and Chatter tab Publishers, and they are standalone. That means that they do not default any lookups to any values. Want to insert a Case? That’s great, but you will need to type the Account and/or Contact in the proper fields. Want to add a Task and relate it to a Case? Have fun; you’ll need to find the Case Number and type it in the proper box. And good luck auto-filling the Contact on that Case without using a trigger.</p>
<p><div id="attachment_4116" style="width: 310px" class="wp-caption alignleft"><a href="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png"><img data-recalc-dims="1" loading="lazy" decoding="async" aria-describedby="caption-attachment-4116" data-attachment-id="4116" data-permalink="https://www.x2od.com/2013/publisher-actions-pt2/screen-shot-2013-07-01-at-5-07-42-pm" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?fit=550%2C435&amp;ssl=1" data-orig-size="550,435" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Standard Create a Task Publisher" data-image-description="" data-image-caption="&lt;p&gt;Note that the Contact is not filled. To fill *two* relationships, you will need a custom publisher and some Apex code.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?fit=300%2C237&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?fit=550%2C435&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM-300x237.png?resize=300%2C237" alt="Standard Create a Task Publisher" width="300" height="237" class="size-medium wp-image-4116" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?resize=300%2C237&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?resize=150%2C118&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2013/07/Screen-Shot-2013-07-01-at-5.07.42-PM.png?w=550&amp;ssl=1 550w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-4116" class="wp-caption-text">Note that the Contact is not filled. To fill *two* relationships, you will need a custom publisher and some Apex code.</p></div></p>
<p>More sophisticated orgs will want to avoid using Global Create actions because even entering an Account record is probably more complicated than can be encapsulated in 8 fields – that don’t recognize page layout-level read-only attributes. That’s right: These create actions are truly global.</p>
<p>So I guess you’ve figured out that I’m not a big fan of Global Create actions.</p>
<p><strong>Object-Specific Create a Record Actions</strong></p>
<p>I like these a lot more. Choose an object (standard or custom), add an Action, select Create a Record, choose from any child object, plus Task and Event (if the object is Activity-enabled), add a Label and Name, update the layout, and you’re off to the races.<br />
In this example, the relevant lookup field is populated. For example, if you create a Task in a Case action, the Task WhatId field will be populated with the Case Number. Again, you’ll need to use a trigger if you want to populate the Task Contact with the Case Contact, but that is beyond the scope of this post.</p>
<p>Of course, what would a post be without saying “<strong>But there’s a catch – there always is?</strong>”</p>
<p><em>Publisher actions can only be executed from the Chatter publisher.</em> This means that you can set them up for any object, but you can only customize the Chatter Publisher on page layouts for objects that have Chatter feed-tracking enabled.</p>
<p>There are far more gotchas with Custom actions, but you’ll have to wait for the next post to see those. I will show code for creating a Task from a Case, creating an Account from the Home tab, and creating a Task from a Case while using Case Feed.</p>
<p>There you have it: Create a Record Custom Actions.</p>
<p>The post <a href="https://www.x2od.com/2013/publisher-actions-pt1">Chatter Publisher Actions (Part 1): Create a Record</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2013/publisher-actions-pt1/feed</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4112</post-id>	</item>
		<item>
		<title>Create and Populate a Map Without Loops</title>
		<link>https://www.x2od.com/2012/populate-map-without-fo-loops</link>
					<comments>https://www.x2od.com/2012/populate-map-without-fo-loops#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Wed, 25 Jul 2012 16:40:33 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1499</guid>

					<description><![CDATA[<p>There are many reasons to use Maps in Apex triggers. Sometimes I want to make a List of Contacts, but I want to pull each one by its ID. This is a good reason to abandon the List and to make a Map&#60;Id, Contact>. (Some will prefer to use Map&#60;String, Contact>, and that is okay [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2012/populate-map-without-fo-loops">Create and Populate a Map&lt;Id, SObject&gt; Without Loops</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>There are many reasons to use Maps in Apex triggers. Sometimes I want to make a List of Contacts, but I want to pull each one by its ID. This is a good reason to abandon the List and to make a <code>Map&lt;Id, Contact></code>. (Some will prefer to use <code>Map&lt;String, Contact></code>, and that is okay too.) We could use a <code>for</code> loop, but let&#8217;s try something more efficient.</p>



<p>This is how I used to populate a <code>Map&lt;Id, Contact></code> of all Contacts at Accounts in a trigger:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; title: ; notranslate">
Map&lt;Id, Contact&gt; cs = new Map&lt;Id, Contact&gt;();
for (Contact c : &#x5B;SELECT id FROM Contact WHERE AccountId IN :trigger.newMap.keyset()]){
    cs.put(c.id, c);
}
</pre></div>


<p>This takes time and uses script statements, and in a big org/app, we want to minimize both.</p>



<p>Here&#8217;s my new way:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: java; title: ; notranslate">
Map&lt;Id, Contact&gt; cs = new Map&lt;Id, Contact&gt;(
    &#x5B;select Id FROM Contact WHERE AccountId IN :trigger.newMap.keyset()]
);
</pre></div>


<p>It&#8217;s pretty simple, and it works well. It also keeps code clean.</p>



<p>More astute readers will note that this is similar to the Trigger context variables <code>Trigger.oldMap</code> &amp; <code>Trigger.newMap</code>, which populate a map of the trigger records keyed to their record ids.</p>
<p>The post <a href="https://www.x2od.com/2012/populate-map-without-fo-loops">Create and Populate a Map&lt;Id, SObject&gt; Without Loops</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2012/populate-map-without-fo-loops/feed</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1499</post-id>	</item>
		<item>
		<title>Workflow ISCHANGED() translated to Apex trigger</title>
		<link>https://www.x2od.com/2012/workflow-ischanged-translated-to-apex-trigger</link>
					<comments>https://www.x2od.com/2012/workflow-ischanged-translated-to-apex-trigger#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Thu, 02 Feb 2012 16:02:29 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1487</guid>

					<description><![CDATA[<p>Workflow is great. I can simply and declaratively make changes, and can easily update things like email templates, criteria, tasks, etc. without using Eclipse and writing/running unit tests.Sometimes, however, workflow isn&#8217;t enough; we need to use a trigger. Today, I had a use-case that when a DateTime field is filled, a contact (identified via a [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2012/workflow-ischanged-translated-to-apex-trigger">Workflow ISCHANGED() translated to Apex trigger</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Workflow is great. I can simply and declaratively make changes, and can easily update things like email templates, criteria, tasks, etc. without using Eclipse and writing/running unit tests.<br />Sometimes, however, workflow isn&#8217;t enough; we need to use a trigger.</p>



<p>Today, I had a use-case that when a DateTime field is filled, a contact (identified via a lookup on a parent object &#8211; so a grandparent record) should receive a notification. That&#8217;s easy enough to do with a ISCHANGED(DateTimeField__c) workflow criteron, but the Email Alert can&#8217;t &#8220;find&#8221; the contact. A trigger is necessary.</p>



<p>Here&#8217;s how I coded the trigger:</p>



<pre class="wp-block-code"><code>trigger InterviewUpdates on Interview__c (after update, before update) {
  if(Trigger.IsBefore){
     for(Interview__c i : Trigger.New){
       if(i.Date_and_Time__c != Trigger.oldMap.get(i.id).Date_and_Time__c){
         // Send email to applicant, passing Interview, DateTime, and Contact
         // (which we found via a query coded outside the loop to avoid governor limits)
        }
     }
  }
}</code></pre>



<p>I&#8217;ve left out a lot of parts here, but I hope that the main bit of using Trigger.oldMap to find the old value and compare it to the new one comes through.</p>



<p>Happy coding!</p>
<p>The post <a href="https://www.x2od.com/2012/workflow-ischanged-translated-to-apex-trigger">Workflow ISCHANGED() translated to Apex trigger</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2012/workflow-ischanged-translated-to-apex-trigger/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1487</post-id>	</item>
		<item>
		<title>Best Practice: Multiple Chatter Posts of the Same File</title>
		<link>https://www.x2od.com/2011/multiple-chatter-posts-file</link>
					<comments>https://www.x2od.com/2011/multiple-chatter-posts-file#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Thu, 11 Aug 2011 16:27:10 +0000</pubDate>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Salesforce CRM]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Chatter]]></category>
		<category><![CDATA[Content]]></category>
		<category><![CDATA[Dreamforce]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1435</guid>

					<description><![CDATA[<p>Salesforce Administrators learn to remind users: &#8220;Search before you create a new lead.&#8221; Pretty simple, right? Duplicated records are a pain. Then why do I see some very accomplished Salesforce users in the Dreamforce app posting duplicate Content/Files in Chatter? Here are some examples from the Files tab: The better thing to do &#8211; assuming [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/multiple-chatter-posts-file">Best Practice: Multiple Chatter Posts of the Same File</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Salesforce Administrators learn to remind users: &#8220;Search before you create a new lead.&#8221;  Pretty simple, right?  Duplicated records are a pain.<br />
Then why do I see some very accomplished Salesforce users in the Dreamforce app posting duplicate Content/Files in Chatter?<br />
Here are some examples from the Files tab:<br />
<div id="attachment_1436" style="width: 560px" class="wp-caption aligncenter"><a href="http://www.x2od.com/2011/08/11/multiple-chatter-posts-file/codeofconduct"><img data-recalc-dims="1" loading="lazy" decoding="async" aria-describedby="caption-attachment-1436" data-attachment-id="1436" data-permalink="https://www.x2od.com/2011/multiple-chatter-posts-file/codeofconduct" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/CodeOfConduct.png?fit=784%2C196&amp;ssl=1" data-orig-size="784,196" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="CodeOfConduct" data-image-description="" data-image-caption="&lt;p&gt;I&amp;#8217;ve learned my lesson in the past 8 months!&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/CodeOfConduct.png?fit=300%2C75&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/CodeOfConduct.png?fit=550%2C137&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/CodeOfConduct-550x137.png?resize=550%2C137" alt="I did it too - uploaded the same file three times instead of linking." title="CodeOfConduct" width="550" height="137" class="size-large wp-image-1436" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/CodeOfConduct.png?resize=550%2C137&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/CodeOfConduct.png?resize=150%2C37&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/CodeOfConduct.png?resize=300%2C75&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/CodeOfConduct.png?w=784&amp;ssl=1 784w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a><p id="caption-attachment-1436" class="wp-caption-text">I&#039;ve learned my lesson in the past 8 months... I promise!</p></div></p>
<p><a href="http://www.x2od.com/2011/08/11/multiple-chatter-posts-file/dreamforce-guide"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="1437" data-permalink="https://www.x2od.com/2011/multiple-chatter-posts-file/dreamforce-guide" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/Dreamforce-Guide.png?fit=781%2C189&amp;ssl=1" data-orig-size="781,189" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Dreamforce Guide" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/Dreamforce-Guide.png?fit=300%2C72&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/Dreamforce-Guide.png?fit=550%2C133&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/Dreamforce-Guide-550x133.png?resize=550%2C133" alt="Seven users uploaded the same file to Content" title="Dreamforce Guide" width="550" height="133" class="size-large wp-image-1437" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/Dreamforce-Guide.png?resize=550%2C133&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/Dreamforce-Guide.png?resize=150%2C36&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/Dreamforce-Guide.png?resize=300%2C72&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/Dreamforce-Guide.png?w=781&amp;ssl=1 781w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a></p>
<p>The better thing to do &#8211; assuming that you need to post the same file multiple times (this should be rare, as it might be considered Chatter Spamming, but when referring multiple users or groups to a document, it can come in handy) is to upload the file ONCE and use references to it in subsequent feed posts.<br />
This has a bonus: Better maintenance!  Instead of other users not knowing which file to follow if they want to be notified anytime that file is updated, just ensure that there is only ONE copy in the org, and everyone can follow that.  This is especially useful for legal documents, employee handbooks, FAQs, Dreamforce App Codes of Conduct&#8230; you get the idea.  </p>
<p>Not sure how it&#8217;s done?  Here are a few screenshots:</p>
<p><div id="attachment_1438" style="width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow.png"><img data-recalc-dims="1" loading="lazy" decoding="async" aria-describedby="caption-attachment-1438" data-attachment-id="1438" data-permalink="https://www.x2od.com/2011/multiple-chatter-posts-file/fileattachwindow" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow.png?fit=782%2C248&amp;ssl=1" data-orig-size="782,248" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="FileAttachWindow" data-image-description="" data-image-caption="&lt;p&gt;Note the selected choice!&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow.png?fit=300%2C95&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow.png?fit=550%2C174&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow-550x174.png?resize=550%2C174" alt="Chatter File attachment screen with choice to link to existing content or to upload new content" title="FileAttachWindow" width="550" height="174" class="size-large wp-image-1438" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow.png?resize=550%2C174&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow.png?resize=150%2C47&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow.png?resize=300%2C95&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/FileAttachWindow.png?w=782&amp;ssl=1 782w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a><p id="caption-attachment-1438" class="wp-caption-text">Note the selected choice!</p></div><br />
<div id="attachment_1440" style="width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection.png"><img data-recalc-dims="1" loading="lazy" decoding="async" aria-describedby="caption-attachment-1440" data-attachment-id="1440" data-permalink="https://www.x2od.com/2011/multiple-chatter-posts-file/file-attach-selection" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection.png?fit=937%2C614&amp;ssl=1" data-orig-size="937,614" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="File Attach Selection" data-image-description="" data-image-caption="&lt;p&gt;Clicking on &amp;#8220;attach&amp;#8221; closes the window&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection.png?fit=300%2C196&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection.png?fit=550%2C360&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection-550x360.png?resize=550%2C360" alt="List of files I can attach.  Leftmost column is word &quot;attach&quot; to choose the file." title="File Attach Selection" width="550" height="360" class="size-large wp-image-1440" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection.png?resize=550%2C360&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection.png?resize=150%2C98&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection.png?resize=300%2C196&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/File-Attach-Selection.png?w=937&amp;ssl=1 937w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a><p id="caption-attachment-1440" class="wp-caption-text">Clicking on &quot;attach&quot; closes the window</p></div><br />
<div id="attachment_1441" style="width: 558px" class="wp-caption aligncenter"><a href="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/ChangeFile.png"><img data-recalc-dims="1" loading="lazy" decoding="async" aria-describedby="caption-attachment-1441" data-attachment-id="1441" data-permalink="https://www.x2od.com/2011/multiple-chatter-posts-file/changefile" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/ChangeFile.png?fit=548%2C260&amp;ssl=1" data-orig-size="548,260" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="ChangeFile" data-image-description="" data-image-caption="&lt;p&gt;Only one file can be attached&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/ChangeFile.png?fit=300%2C142&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/ChangeFile.png?fit=548%2C260&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/ChangeFile.png?resize=548%2C260" alt="The file is selected, and there is a link to change to a different file if I choose." title="ChangeFile" width="548" height="260" class="size-full wp-image-1441" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/ChangeFile.png?w=548&amp;ssl=1 548w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/ChangeFile.png?resize=150%2C71&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/08/ChangeFile.png?resize=300%2C142&amp;ssl=1 300w" sizes="auto, (max-width: 548px) 100vw, 548px" /></a><p id="caption-attachment-1441" class="wp-caption-text">Only one file can be attached</p></div><br />
And there you have it!  Go forth and attach!  &#8230; and after that, just link.</p>
<p>The post <a href="https://www.x2od.com/2011/multiple-chatter-posts-file">Best Practice: Multiple Chatter Posts of the Same File</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/multiple-chatter-posts-file/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1435</post-id>	</item>
		<item>
		<title>Next Birthday Formula</title>
		<link>https://www.x2od.com/2011/next-birthday-formula</link>
					<comments>https://www.x2od.com/2011/next-birthday-formula#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Wed, 06 Jul 2011 16:45:32 +0000</pubDate>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Apex]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1429</guid>

					<description><![CDATA[<p>How would you display your Contacts with upcoming birthdays? I&#8217;ve seen people use &#8220;Birthdays This Week,&#8221; &#8220;Birthdays This and Next Week,&#8221; and other reports to display the list. I&#8217;ve also seen requirements for showing a person&#8217;s next birthday, to trigger an automatic email to each Contact on his/her birthday. Let&#8217;s see how it&#8217;s done: if( [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/next-birthday-formula">Next Birthday Formula</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>How would you display your Contacts with upcoming birthdays?  I&#8217;ve seen people use &#8220;Birthdays This Week,&#8221; &#8220;Birthdays This and Next Week,&#8221; and other reports to display the list.
</p><p>
I&#8217;ve also seen requirements for showing a person&#8217;s next birthday, to trigger an automatic email to each Contact on his/her birthday.  Let&#8217;s see how it&#8217;s done:</p>
<pre class="brush: plain; title: Formula: Next Birthday; notranslate">if(
Month (Birthdate) &lt; = Month(Datevalue( NOW() ) ),
   if ( Month (Birthdate) &lt; Month(Datevalue( NOW() ) ),
      DATE( YEAR( DATEVALUE( NOW() ) ) + 1 , MONTH( Birthdate ) , DAY( Birthdate ) ),
      if ( Day (Birthdate) &lt; Day ( Datevalue ( NOW() ) ),
          DATE( YEAR( DATEVALUE( NOW() ) ) + 1 , MONTH( Birthdate ) , DAY( Birthdate ) ),
          DATE( YEAR( DATEVALUE( NOW() ) )  , MONTH( Birthdate ) , DAY( Birthdate ) )
      )
   ),
DATE( YEAR( DATEVALUE( NOW() ) ) , MONTH( Birthdate ) , DAY( Birthdate ) )
)
</pre>
<p>Next, use Batch Apex to send an email daily to all people where <code>Next_Birthday__c == date.today()</code>.  Easy!</p>
<p>Now we can put this into a report and a dashboard showing the next &#8220;n&#8221; birthdays.  Sure, it&#8217;s possible that more than n people will have a birthday on a given day, but at least you know that the emails will go out to each of them!  If you want to see everyone with birthdays in a certain range, make a custom report and click through from a dashboard or a custom link.</p>
<p>Enjoy!</p><p>The post <a href="https://www.x2od.com/2011/next-birthday-formula">Next Birthday Formula</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/next-birthday-formula/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1429</post-id>	</item>
		<item>
		<title>PageReference Best Practice</title>
		<link>https://www.x2od.com/2011/pagereference-best-practice</link>
					<comments>https://www.x2od.com/2011/pagereference-best-practice#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Thu, 05 May 2011 16:30:23 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Visualforce]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1282</guid>

					<description><![CDATA[<p>I've seen a lot of coders put the following into their custom Visualforce controllers: public PageReference customsave() { try{ insert acct; } catch (DMLException e) { /*do stuff here*/ } PageReference acctPage = new PageReference ('/' + acct.id}; acctPage.setRedirect(true); return acctPage; } I've decided that I don't like this approach. It feels too much like [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/pagereference-best-practice">PageReference Best Practice</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I've seen a lot of coders put the following into their custom Visualforce controllers:</p>

<pre class="brush: java; title: ; notranslate">
public PageReference customsave() {
    try{ 
        insert acct; 
    } catch (DMLException e) { 
        /*do stuff here*/ 
    }
    PageReference acctPage = new PageReference ('/' + acct.id};
    acctPage.setRedirect(true);
    return acctPage;
}
</pre>
<p>
I've decided that I don't like this approach.  It feels too much like a URL hack, and though I'm sure that it will always work (meaning that salesforce.com will never change its way of referring to a record by <code>/&lt;recordID&gt;</code>), I'd like to suggest a different method that may use more resources, but will leverage standard controllers, possibly future-proofing the application:
</p>
<pre class="brush: java; title: ; notranslate">
public PageReference customsave() {
    insert acct; //Error handling removed for brevity. ALWAYS try/catch!
    ApexPages.StandardController sc = new ApexPages.StandardController(acct);
    PageReference acctPage = sc.view();
    acctPage.setRedirect(true);
    return acctPage;
}
</pre>

<p>What do you think?  Does anyone have coding-style tips to share?</p><p>The post <a href="https://www.x2od.com/2011/pagereference-best-practice">PageReference Best Practice</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/pagereference-best-practice/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1282</post-id>	</item>
		<item>
		<title>Content Latest Version Flag</title>
		<link>https://www.x2od.com/2011/content-latest-version-flag</link>
					<comments>https://www.x2od.com/2011/content-latest-version-flag#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Wed, 04 May 2011 20:29:11 +0000</pubDate>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Salesforce CRM]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1359</guid>

					<description><![CDATA[<p>Yesterday, I used Content Delivery to send a pdf to a client. Simple, right? Upload the Word document to Content, associate it with a record, and deliver the content. Surely if I upload a new version, the delivery will refer to the latest version, right? There&#8217;s no place to select that option, so I can [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/content-latest-version-flag">Content Latest Version Flag</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Yesterday, I used Content Delivery to send a pdf to a client. Simple, right? Upload the Word document to Content, associate it with a record, and deliver the content. Surely if I upload a new version, the delivery will refer to the latest version, right? There&#8217;s no place to select that option, so I can assume, right?</p>



<p>Wrong.</p>



<p>This is the screen I see when I choose to deliver a given file. Note that I can choose whether to allow access to the original file or only to a pdf&#8230; but nothing about which version to deliver. (There are 4 versions right now.)</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="http://www.x2od.com/2011/05/04/content-latest-version-flag.html/content-delivery-options" rel="attachment wp-att-1403"><img data-recalc-dims="1" loading="lazy" decoding="async" width="550" height="313" data-attachment-id="1403" data-permalink="https://www.x2od.com/2011/content-latest-version-flag/content-delivery-options" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Options.png?fit=600%2C342&amp;ssl=1" data-orig-size="600,342" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Content-Delivery-Options" data-image-description="" data-image-caption="&lt;p&gt;Content Delivery Options&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Options.png?fit=300%2C171&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Options.png?fit=550%2C313&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Options-550x313.png?resize=550%2C313" alt="Options available when configuring a Content Delivery" class="wp-image-1403" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Options.png?resize=550%2C313&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Options.png?resize=150%2C85&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Options.png?resize=300%2C171&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Options.png?w=600&amp;ssl=1 600w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a><figcaption class="wp-element-caption">Content Delivery Options</figcaption></figure>
</div>


<p>The document in question needed some changes, so I uploaded a new version and told the client that the old link would still work. Oops.</p>



<p>By default, Content Deliveries are set to refer to one specific version of a Content file. I can understand this, but surely I should be given the opportunity to change that?</p>



<p>To do this, view the Delivery record and see the following:</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="http://www.x2od.com/2011/05/04/content-latest-version-flag.html/content-delivery-record" rel="attachment wp-att-1404"><img data-recalc-dims="1" loading="lazy" decoding="async" width="550" height="215" data-attachment-id="1404" data-permalink="https://www.x2od.com/2011/content-latest-version-flag/content-delivery-record" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Record.png?fit=562%2C220&amp;ssl=1" data-orig-size="562,220" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Content-Delivery-Record" data-image-description="" data-image-caption="&lt;p&gt;Content Delivery Record Detail View&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Record.png?fit=300%2C117&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Record.png?fit=550%2C215&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Record-550x215.png?resize=550%2C215" alt="Content Delivery Record Detail View" class="wp-image-1404" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Record.png?resize=550%2C215&amp;ssl=1 550w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Record.png?resize=150%2C58&amp;ssl=1 150w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Record.png?resize=300%2C117&amp;ssl=1 300w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2011/05/Content-Delivery-Record.png?w=562&amp;ssl=1 562w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a><figcaption class="wp-element-caption">Content Delivery Record Detail View</figcaption></figure>
</div>


<p>Click <code>Edit</code> and check the appropriate checkbox.</p>



<p>There you have it! A few extra clicks, but a Content Delivery can point to the latest version.</p>



<p>Do you use Content Deliveries? How do you like it?</p>
<p>The post <a href="https://www.x2od.com/2011/content-latest-version-flag">Content Latest Version Flag</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/content-latest-version-flag/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1397</post-id>	</item>
		<item>
		<title>PersonAccount Stay-In-Touch Gotcha</title>
		<link>https://www.x2od.com/2011/perso-stay-in-touch-gotcha</link>
					<comments>https://www.x2od.com/2011/perso-stay-in-touch-gotcha#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Mon, 28 Mar 2011 17:00:53 +0000</pubDate>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Native Application]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Force.com Builder]]></category>
		<category><![CDATA[PersonAccount]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1331</guid>

					<description><![CDATA[<p>I make no secret that I&#8217;m a fan of PersonAccounts.  I think they&#8217;re  very handy when working with individuals instead of companies, and I  really like pairing them with the Relationship Groups app to make  households. I&#8217;ve always considered them as mostly-contacts.  I put all Person  fields on the Contact object, reserving very few for [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/perso-stay-in-touch-gotcha">PersonAccount Stay-In-Touch Gotcha</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I make no secret that I&#8217;m a fan of PersonAccounts.  I think they&#8217;re  very handy when working with individuals instead of companies, and I  really like pairing them with the Relationship Groups app to make  households.</p>
<p>I&#8217;ve always considered them as mostly-contacts.  I put all Person  fields on the Contact object, reserving very few for the Account  object.  But for some reason, I&#8217;ve usually used Billing Address as the  primary address and Mailing as the secondary.  No reason &#8211; that&#8217;s just  how I&#8217;ve done it.</p>
<p>That all changed yesterday.  I was prepping to demo a system to a  company and decided to click the &#8220;Request Update&#8221; button to send a  Stay-In-Touch email.  This is not a customizable email (well, not much)  in terms of the fields from the Contact that it displays, so it used the  Mailing Address.  Oops!</p>
<p>From now on, I am using Mailing and Other addresses for PersonAccounts.  Billing, you&#8217;re reserved for BusinessAccounts.</p>
<p>Feel free to debate the merits and drawbacks of PersonAccounts below &#8211; I&#8217;ll respond to them in a future post.</p>
<p>﻿</p>
<p>The post <a href="https://www.x2od.com/2011/perso-stay-in-touch-gotcha">PersonAccount Stay-In-Touch Gotcha</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/perso-stay-in-touch-gotcha/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1331</post-id>	</item>
		<item>
		<title>Chatter BINGO Released Into The Wild</title>
		<link>https://www.x2od.com/2011/chatter-bingo-released</link>
					<comments>https://www.x2od.com/2011/chatter-bingo-released#respond</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Fri, 25 Mar 2011 18:02:25 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Visualforce]]></category>
		<category><![CDATA[X-Squared On Demand]]></category>
		<category><![CDATA[#df10]]></category>
		<category><![CDATA[AppExchange]]></category>
		<category><![CDATA[Just for fun]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1322</guid>

					<description><![CDATA[<p>With Dreamforce 2010 behind us and Dreamforce 2011 fast approaching, the first ever crowdsourced conference application is publicly available! Chatter BINGO has been released as an unmanaged package, meaning that all the source code is open and ready for customizing to your hearts&#8217; content. Chatter BINGO was conceived by Chris Shackelford and Brad Gross (@imperialstout) [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/chatter-bingo-released">Chatter BINGO Released Into The Wild</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>With Dreamforce 2010 behind us and Dreamforce 2011 fast approaching, the first ever crowdsourced conference application is publicly available!</p>
<p>Chatter BINGO has been released as an unmanaged package, meaning that all the source code is open and ready for customizing to your hearts&#8217; content.</p>
<p>Chatter BINGO was conceived by Chris Shackelford and Brad Gross (@imperialstout) while chattering in the Dreamforce org, and they asked me to build it.  Within two weeks, it had passed QA and was deployed to the org.</p>
<p>One of my favorite moments from Dreamforce was at the Tweetup (#df10tu &#8211; see you at <a href="http://twitter.com/search?q=%23df11tu">#df11tu</a>) when someone walked up to me with a printout of the PDF BINGO card she had generated, asking me to mark myself on the page.  It always feels good to see people enjoying one&#8217;s work!</p>
<p>The listing is at <a href="http://www.x2od.com/getchatterbingo">http://www.x2od.com/getchatterbingo</a>.</p>
<p>Enjoy!</p>
<p>The post <a href="https://www.x2od.com/2011/chatter-bingo-released">Chatter BINGO Released Into The Wild</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/chatter-bingo-released/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1322</post-id>	</item>
		<item>
		<title>Activity Type Field &#8211; Do Not Use</title>
		<link>https://www.x2od.com/2011/activity-type-field-do-not-use</link>
					<comments>https://www.x2od.com/2011/activity-type-field-do-not-use#respond</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Mon, 21 Mar 2011 17:00:25 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1292</guid>

					<description><![CDATA[<p>The field Event.Type (which is sort of the same as Task.Type) is a difficult field to use.  Here are a few reasons: Type cannot be the controlling field for a dependent picklist. On an Event list view (/007), even when specifying record type, the Type field cannot be edited. Salesforce requires you to select a [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/activity-type-field-do-not-use">Activity Type Field &#8211; Do Not Use</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[The field Event.Type (which is sort of the same as Task.Type) is a difficult field to use.  Here are a few reasons:
<ul>
	<li>Type cannot be the controlling field for a dependent picklist.</li>
	<li>On an Event list view (/007), even when specifying record type, the Type field cannot be edited.</li>
	<li>Salesforce requires you to select a default value for this picklist, as well as a default value for inbound emails... yet when I bcc my Email-To-Salesforce address, the resulting tasks have no Type value.</li>
</ul>
A tweet by Andy Ognenoff of Manpower (<a href="http://twitter.com/aognenoff">@aognenoff</a>) <a href="https://twitter.com/#!/aognenoff/status/48789550641856512">revealed</a> another limitation: Type is not available in Custom Report Types.

That does it!  I'm done with this field.  Here's my solution.
<ol>
	<li>Work in a sandbox (duh)</li>
	<li>Create a picklist field on Activity (ActivityType__c).</li>
	<li>Disable all Activity workflow rules, Chatter feeds, triggers, etc.</li>
	<li>Using DataLoader, copy values from Type to ActivityType__c.</li>
	<li>Using Field Level Security, hide Type from all profiles.  It's just not necessary.</li>
	<li>Edit/reactivate all your workflow, feeds, triggers, etc.</li>
	<li>Use/adapt the code below.</li>
	<li>Test thoroughly and deploy to production.</li>
</ol>
The Salesforce Mobile application (at least for Blackberry) defaults to a Subject "Call: (212) 555-1212" style.  This will account for that.  It also handles emails sent with Email-To-Salesforce, which starts the subject with "Email:"

<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;"> </span>

<pre class="brush: java; title: ; notranslate">
trigger TaskTrigger on Task (before insert, before update) {
     ActivityHelper.UpdateTaskType(Trigger.new);
}
</pre>

<pre class="brush: java; title: ; notranslate">
trigger EventTrigger on Event (before insert, before update) {
     ActivityHelper.UpdateEventType(Trigger.new);
}
</pre>

This class isn't perfect, but it gets the job done.  I should add try/catch statements in my test code (though I have heard recently that it's not a good idea to do so, as one may WANT the code to fail with an error if something doesn't go as expected).

<pre class="brush: java; title: ; notranslate">
// Written by David Schach, X-Squared On Demand
public with sharing class ActivityHelper {

    public static void UpdateEventType(Event&#x5B;] events){
        for (Event e : events){
            if(e.ActivityType__c == '' || e.ActivityType__c == null){
                if(e.Subject.contains('Email'))
                    e.ActivityType__c = 'Email';
                else if(e.Subject.contains('Call'))
                    e.ActivityType__c = 'Call';
                else if (e.Subject.contains('Meet') || e.Subject.contains('Webinar'))
                    e.ActivityType__c = 'Meeting';
            }
        }
    }
    
    public static void UpdateTaskType(Task&#x5B;] tasks){
        for (Task t : tasks){
            if(t.ActivityType__c == '' || t.ActivityType__c == null){
                if(t.Subject.contains('Email ') || t.Subject.contains('Email:'))
                    t.ActivityType__c = 'Email';
                else if(t.Subject.contains('Call'))
                    t.ActivityType__c = 'Call';
                else if (t.Subject.contains('Meet') || t.Subject.contains('Webinar'))
                    t.ActivityType__c = 'Meeting';
            }
        }
    }
    
    private static Event newTestEvent(string subject){
        Event e = new Event();
        e.Subject = subject;
        e.startdatetime = datetime.now();
        e.DurationInMinutes = 60;
        e.ActivityType__c = ''; // To account for default value.
        return e;
    }

    private static Task newTestTask(string subject){
        Task t = new Task();
        t.Subject = subject;
        t.Priority = 'Medium';
        t.Status = 'New';
        t.ActivityType__c = ''; // To account for default value.
        return t;
    }   

    static TestMethod void TestEvents(){
        test.starttest();
        List&lt;Event&gt; ourevents = new List&lt;Event&gt;();
        ourevents.add(newTestEvent('e1'));
        ourevents.add(newTestEvent('Email: Thank you'));
        ourevents.add(newTestEvent('Call: (212) 555-1212'));
        ourevents.add(newTestEvent('Webinar tomorrow'));
        ourevents.add(newTestEvent('Meet Jack'));
        ourevents.add(newTestEvent('Sales time'));
        insert ourevents;
        update ourevents;
        for (Event e : &#x5B;SELECT id, Type from Event WHERE id in :ourEvents]){
            system.debug('EVENT TYPE: ' + e.ActivityType__c);
        }
        test.stoptest();
    }
    
    static TestMethod void TestTasks(){
        test.starttest();
        List&lt;Task&gt; ourTasks = new List&lt;Task&gt;();
        ourTasks.add(newTestTask('e1'));
        ourTasks.add(newTestTask('Email: Thank you'));
        ourTasks.add(newTestTask('Call: (212) 555-1212'));
        ourTasks.add(newTestTask('Webinar tomorrow'));
        ourTasks.add(newTestTask('Meet Jack'));
        ourTasks.add(newTestTask('Sales time'));
        insert ourTasks;
        update ourTasks;
        for (Task t : &#x5B;SELECT id, Type from Task WHERE id in :ourTasks]){
            system.debug('TASK TYPE: ' + t.ActivityType__c);
        }
        test.stoptest();
    }
    
    static testMethod void IndividualActivityTest() {
      Event e = newTestEvent('e1');
      Task t = newTestTask('t1');
      test.starttest();
      insert e;
      insert t;
      e.subject = 'Meeting';
      update e;
      e.subject = 'Call: Geoff Peterson';
      update e;
      e.subject = 'Email: Here we go';
      update e;
      e.subject = 'Webinar';
      update e;
      t.subject = 'Meeting';
      update t;
      t.subject = 'Call';
      update t;
      t.subject = 'Email';
      update t;
      t.subject = 'Webinar';
      update t;
      test.stoptest();
    }
}
</pre> <p>The post <a href="https://www.x2od.com/2011/activity-type-field-do-not-use">Activity Type Field &#8211; Do Not Use</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/activity-type-field-do-not-use/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1292</post-id>	</item>
		<item>
		<title>Which has the most potential for enterprise-wide adoption: iPad or Cr-48?</title>
		<link>https://www.x2od.com/2011/ipad-or-cr48</link>
					<comments>https://www.x2od.com/2011/ipad-or-cr48#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Fri, 04 Mar 2011 18:00:02 +0000</pubDate>
				<category><![CDATA[Partners]]></category>
		<category><![CDATA[X-Squared On Demand]]></category>
		<category><![CDATA[Infowelders]]></category>
		<category><![CDATA[sfdcverse]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1286</guid>

					<description><![CDATA[<p>This is a collaborative post with Nick Hamm (@hammnick), Director of Technology at Infowelders and David Schach (@dschach) from X-Squared On Demand.  After a conversation via twitter, we decided to collaborate on a blog post (via Google Docs, of course) and are publishing it in our own blogs simultaneously. With all of the hype around [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/ipad-or-cr48">Which has the most potential for enterprise-wide adoption: iPad or Cr-48?</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a collaborative post with Nick Hamm (<a title="@hammnick" href="http://twitter.com/hammnick" target="_blank">@hammnick</a>), Director of Technology at Infowelders and David Schach (<a title="@dschach" href="http://twitter.com/dschach" target="_blank">@dschach</a>) from X-Squared On Demand.  After a conversation via twitter, we decided to collaborate on a blog post (via Google Docs, of course) and are publishing it in our own blogs simultaneously.</p>
<p>With all of the hype around the pending release of iPad2 and how it has <a href="http://www.google.com/url?q=http%3A%2F%2Fpaidcontent.org%2Farticle%2F419-apples-jobs-says-ipad-2-makes-it-official-pc-era-is-done%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNGJ9RNCmtXjFT8fBB-VbcWHVowNlA" target="_blank">firmly moved us into the &#8220;post-PC era&#8221;</a>, we had to take a step back and evaluate for ourselves whether all of the hype is justified, or if Steve Jobs&#8217; mastery of the emotional sell has hypnotized Apple fan-boys and non-fan-boys alike into believing that we are in a reality that isn&#8217;t quite real, or even realistic.</p>
<p><strong>The Case for iPad</strong></p>
<p>The iPad is a game-changing device in many ways, but it&#8217;s main impact is as a consumer/personal technology.  Apps are the primary driver that sell the hardware (or at least allows Apple to charge a premium for the hardware), and Apple&#8217;s AppStore is mostly consumer-focused.  I&#8217;m sure Jobs had the vision that these devices could be used by business, but that was not their primary target with iPad Gen 1, and is still not their primary market with iPad Gen 2.  However, Apple has quickly started to build a story around business adoption, and has started to gain adoption in businesses from startups to Fortune 500 companies.  More on that later.</p>
<p>We have to remember that it didn&#8217;t start with the iPad &#8211; it started with the Palm.  Stylus-input devices were the first widely-used mobile hardware, and one of the Palm Tungsten models had a phone built-in.  Then Blackberry entered the marketplace and dominated the business mobile device market.  The Blackberry could be standardized and controlled by IT.  But with iPhones being purchased in the homes of business people, and those folks taking their newly found iPhone addiction back to their IT department, Apple has definitely made up for lost time.  In fact, even though IT has lost most of its control over the company&#8217;s devices, the iPhone has gained grassroots traction to become the new standard-issue phone for many organizations.  Why is this important?  For two reasons: 1) The iPad is a giant iPhone, and 2) The same consumer-to-business adoption path is happening for the iPad.</p>
<p>Our companies consult businesses that have 20 employees and &gt; 2000 employees.  So we see a pretty wide array of IT cultures and standards.  We also get to see how some of the decisions to use device X over device Y are made by the business.  Very few of our clients are &#8220;.com tech companies&#8221; &#8211; most are traditional businesses that do anything from conduit manufacturing to healthcare facility management to spirits distillation and distribution.  One would think that the larger companies would be slower moving and less likely to adopt new technologies, and in some cases that is true, but overall we are seeing a higher adoption rate of iDevices at the larger companies.  This is somewhat counter-intuitive until you learn the reasons why.  We have seen more than one instance where an executive either bought an iPad for personal use or received one as a gift, and within weeks (or days) mandated to IT that his/her field reps also use the device.  This is a powerful demonstration that Apple has not had to focus marketing toward businesses in order to gain adoption within the enterprise.</p>
<p>Based on these comments so far, you may be asking why we even asked the question of enterprise-wide adoption in the first place.  Well, there is an important caveat in these examples.  The largest job role for business iPad adopters are mobile users.  For most businesses this translates to sales and biz dev reps, who do a lot of presenting (slideshows) or data consumption (charts and graphs) and not as much data entry.  The iPad&#8217;s focused functionality makes it ideal for less-technical users, and it&#8217;s stylish caché make it ideal to put in the hands of the guy or gal representing your company because it is a recognizable device that those who don&#8217;t yet have one are intrigued by and envious of.  But those are not the benefits that are going to drive the business to collect the desktops and laptops from the rest of the employees and replace them all with iPads tomorrow.  In fact, Apple has seen spikes in sales of their other more traditional hardware offerings to businesses since the iPad has been released, and in a lot of cases the iPad is only acting as a complementary device to the desktop/laptop for these users.</p>
<p>The majority of in-office workers at our clients interact with their computers in two ways: data entry (including, using Salesforce CRM as an example, writing notes from sales phone calls) and wizard-driven tasks (such as a call-center service representative).  Both of these roles require efficient information-entry (using a keyboard or a mouse) and a powerful browser.  The iPad has neither; yes Safari is good, but it cannot display Salesforce perfectly or deliver Flash, and that&#8217;s a deal-breaker.</p>
<p>iPad doesn&#8217;t have what it takes to root out the traditional PC/laptop from most business users and become their primary work device.  At least not yet.</p>
<p><strong>The Case for the Google Cr-48</strong></p>
<p>We&#8217;ll start by saying that Cr-48 hardware is not game-changing &#8211; it&#8217;s little more than a netbook with a bigger screen. It&#8217;s the OS and concept of a cloud-only device in a familiar form factor that give us a glimpse into what the business devices of the near future could look like.  Google knows as well as anyone that cloud adoption is happening at an exponential pace right now, both by consumers and by businesses.  As more and more business applications are being moved to the cloud, including email, document creation, CRM, and other core biz apps, the need for a thick-client PC or laptop is quickly going the way of the Palm Pilot.</p>
<p>The main difference behind a cloud-based OS device like the Cr-48 and the iPad is that it comes in the same form that we are all used to &#8211; a laptop with a tactile keyboard (data entry), VGA (display) and USB (mouse/thumb drive) ports, and a browser that performs all of the full feature functions that we are used to performing.  Users don&#8217;t drastically have to change the way they are used to interacting with this device.  For anyone who has to do a lot of data entry, graphic design, document editing, or even just general typing, the choice between using the Cr-48 and an iPad as a primary input device is very simple &#8211; type on your Cr-48 while you&#8217;re watching The Hangover on Netflix with the iPad.</p>
<p>But for what the cloud OS brings to table as far as utility, it falls behind in the areas of flashiness and ultra-portability.  It&#8217;s primary purpose is to do more with less hardware and IT infrastructure, not knock the socks off of the executives to which you are trying to sell to your widgets.  The entry point to businesses for the cloud OS will be through the IT department, not through the executive team, which means that adoption could happen at a slower rate.  You also need to have most or all of your business applications available in the cloud to replace your PC/laptop with a Cr-48, a scenario which is not yet reality for most companies today.  We should also point out that the Cr-48 is just in the beginning stages of pilot, and probably won&#8217;t see the light of day in a production-ready device until late 2011 at the earliest.  So it&#8217;s a little bit of an apples and oranges argument to compare the two devices.  Which leads to our conclusion&#8230;</p>
<p><strong>The Net-Net: Can&#8217;t we all just get along?</strong></p>
<p>If there are two things that are clear from this debate they are: 1) The iPad is not ready to become the primary computing device for most business users, and 2) The cloud OS is still an emerging technology that will most definitely have an impact on the business computers of the near future.  In our view, it&#8217;s not an all or nothing proposition.  The iPad is the perfect device for certain types of business users that are mobile, have customer-facing responsibilities, or consume data/metrics (salespeople and executives), but even those two groups of users are unlikely to give up their desktops/laptops/netbooks.  The cloud OS is the perfect solution for business users who require computing utility and still need a mouse and keyboard to effectively perform their tasks.  This would seem to point to the conclusion that neither device has the potential to become an enterprise-wide standard.  The advantage we can see with the cloud OS scenario is that one gets more utility for approximately the same price point.  To IT, the iPad will be accepted because the mandate has been handed up-then-down; however, to that IT department itself, one that has spent blood, sweat, and tears moving the business to the cloud, the cloud OS will be a very logical choice.  The war for standardization one way or the other (or a compromise to adopt both) will be decided in the board rooms between CITOs, CFOs, and CEOs over the coming months. And while Apple&#8217;s iPad has all of the unchallenged hype today, Google is quietly waging a campaign to take over the market share that Microsoft is losing due to Apple&#8217;s &#8220;post-PC&#8221; marketing pitch.</p>
<p>What are your thoughts on enterprise adoption of iDevices, cloud computing, and cloud OS?  What are your thoughts on enterprise maintenance of traditional computing (OSX/PC/Linux) devices?</p>
<p>The post <a href="https://www.x2od.com/2011/ipad-or-cr48">Which has the most potential for enterprise-wide adoption: iPad or Cr-48?</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/ipad-or-cr48/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1286</post-id>	</item>
		<item>
		<title>Visualforce Inline Editing &#8211; I&#8217;m In Love</title>
		<link>https://www.x2od.com/2011/vf-inlineediting-love</link>
					<comments>https://www.x2od.com/2011/vf-inlineediting-love#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Mon, 28 Feb 2011 18:00:00 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Force.com Platform]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Visualforce]]></category>
		<category><![CDATA[Apex]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1240</guid>

					<description><![CDATA[<p>I&#8217;m totally addicted to the new Visualforce inline editing feature. It all started with this post by Josh Birk at Developerforce. I liked it, but as a &#8220;standardstylesheets&#8221; specialist, I wanted a bit more. Then I looked at the Visualforce apex:inlineEditSupport documentation, and I was hooked. Okay, so you&#8217;re probably wondering why this is so [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/vf-inlineediting-love">Visualforce Inline Editing &#8211; I&#8217;m In Love</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m totally addicted to the new Visualforce inline editing feature.  It all started with this <a href="http://blog.sforce.com/sforce/2011/02/spring-11-the-visualforce-inline-editing-component.html">post</a> by Josh Birk at Developerforce.  I liked it, but as a &#8220;standardstylesheets&#8221; specialist, I wanted a bit more.</p><p>
Then I looked at the Visualforce <a href="http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inlineEditSupport.htm">apex:inlineEditSupport</a> documentation, and I was hooked.</p><p>
Okay, so you&#8217;re probably wondering why this is so neat.  I&#8217;ll show you how to enable fields for inline editing, and then I&#8217;ll show you why the apex:inlineEditSupport tag is completely unnecessary!</p><p>
Here&#8217;s a simple example.  You&#8217;ll notice that inline edit support has only been given to the contact.phone field.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;apex:page standardController=&quot;Contact&quot; standardstylesheets=&quot;true&quot;
	showheader=&quot;true&quot;&gt;
	&lt;apex:form &gt;
		&lt;apex:pageBlock mode=&quot;maindetail&quot;&gt;
			&lt;apex:pageBlockButtons &gt;
				&lt;apex:commandButton action=&quot;{!edit}&quot; id=&quot;editButton&quot; value=&quot;Edit&quot; /&gt;
				&lt;apex:commandButton action=&quot;{!save}&quot; id=&quot;saveButton&quot; value=&quot;Save&quot; /&gt;
				&lt;apex:commandButton onclick=&quot;resetInlineEdit()&quot; id=&quot;cancelButton&quot;
					value=&quot;Cancel&quot; /&gt;
			&lt;/apex:pageBlockButtons&gt;
			&lt;apex:pageBlockSection &gt;
				&lt;apex:outputField value=&quot;{!contact.lastname}&quot;/&gt;
				&lt;apex:outputField value=&quot;{!contact.accountId}&quot; /&gt;
				&lt;apex:outputField value=&quot;{!contact.phone}&quot;&gt;
					&lt;apex:inlineEditSupport showOnEdit=&quot;saveButton, cancelButton&quot;
						hideOnEdit=&quot;editButton&quot; event=&quot;ondblclick&quot;
						resetFunction=&quot;resetInlineEdit&quot; /&gt;
					&lt;/apex:outputfield&gt;
			&lt;/apex:pageBlockSection&gt;
		&lt;/apex:pageBlock&gt;
	&lt;/apex:form&gt;
&lt;/apex:page&gt;
</pre>
<ol>
	<li>resetInlineEdit() is referenced in the code, but the actual Javascript isn&#8217;t shown anywhere. PLEASE don&#8217;t be fooled by the bad code in the documentation: It works perfectly for that &#8220;undo&#8221; arrow by the inline edit field, but it doesn&#8217;t work on the cancel button.</li>
	<li>changedStyleClass is optional. Omitting it uses the standard style we&#8217;re all used to.  And referring to a style that isn&#8217;t included anywhere just defaults to the system default.</li>
	<li>PageBlock here has no &#8220;mode&#8221; attribute.  This means that we can specify only the fields we want for inline editing.  However, if we place the inlineEditSupport tag as an immediate child of the PageBlock, it will apply to every field in that PageBlock (or dataList, dataTable, form, outputField, pageBlockSection, pageBlockTable, repeat).</li>
	
</ol>
<p>Here&#8217;s my next step: Find a way to hide the Cancel button on pageload, but show it when any field is inlineEdited.  Javascript gurus have a solution?</p>

<p>(An aside: In Josh&#8217;s code sample, he uses a standard method called &#8220;quicksave.&#8221;  It&#8217;s not in the Apex or Visualforce documentation, but we find <a href="http://wiki.developerforce.com/index.php/An_Introduction_to_Visualforce">here</a> that &#8220;The quickSave() method on the standard controller performs the same database operation as the save() method but returns the user to the same page rather than navigating away.&#8221;)</p>
<p><b>Want to know why this is unnecessary?</b></p>
It is undocumented, but is shown in the code sample in the Visualforce guide: use
<pre class="brush: xml; title: ; notranslate">
&lt;apex:PageBlock mode=&quot;inlineEdit&quot; &gt;
</pre>
<p>to set every field to inlineEdit and use default styles, etc.  I don&#8217;t know how it will affect buttons shown/hidden, but give it a shot.</p>

<p>
The attributes for inlineEditSupport are pretty simple:</p>
<table style="border-collapse: collapse;" border="1">
<tbody>
<tr>
<th>Attribute Name</th>
<th>My Description</th>
</tr>
<tr>
<td>changedStyleClass</td>
<td>can refer to a style class included in the page or in a referenced CSS sheet in Static Resources</td>
</tr>
<tr>
<td>disabled</td>
<td>disables inline editing.  This is really cool because you can put any logic in here.  (On a separate note, inline editing respects field-level security, so if the user can&#8217;t edit a field, this attribute is basically set to TRUE.
<br />
This is also a good tag because it lets you avoid using the rendered attribute with a plain outputtext/outputfield component to do your &#8220;can the user edit this&#8221; logic.</td>
</tr>
<tr>
<td>event</td>
<td>What makes the field switch from output to input. This is the usual list of Javascript events. (ondblclick, onmouseover, onmousedown, etc)</td>
</tr>
<tr>
<td>hideOnEdit</td>
<td>This one is cool.  Give every commandButton on the page an id (because you do that anyway, right?) and then list the ones that should only be shown when this field is in input mode.</td>
</tr>
<tr>
<td>id</td>
<td>Seriously, folks, always give your elements ids.  Not only is it good practice for adding Javascript to your page, but it avoids that silly &#8220;j_40&#8221; style id automatically generated&#8230; which shows when I view the source of your page, making you look bad.</td>
</tr>
<tr>
<td>rendered</td>
<td>We all know how to use this.  I admit: I can&#8217;t think of a reason to use this as a child of outputfield, but I can certainly think of reasons to use it when it&#8217;s a child of apex:repeat, as those don&#8217;t necessarily respect field-level security when used with custom controllers.</td>
</tr>
<tr>
<td>resetFunction</td>
<td>This one is addressed below. It&#8217;s the Javascript function that resets the field, undoing all non-committed inline edits.</td>
</tr>
<tr>
<td>showOnEdit</td>
<td>Buttons to show when the field is edited. See hideOnEdit.</td>
</tr>
</tbody>
</table>
<p>What are your next steps?  Planning to add this to your page layouts?  Looks like anyone with cool tools to convert regular page layouts to Visualforce layouts is going to have a lot of work to do!</p><p>The post <a href="https://www.x2od.com/2011/vf-inlineediting-love">Visualforce Inline Editing &#8211; I&#8217;m In Love</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/vf-inlineediting-love/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1240</post-id>	</item>
		<item>
		<title>System Replacement For isTest Apex Method</title>
		<link>https://www.x2od.com/2011/system-replacement-for-istest-apex-method</link>
					<comments>https://www.x2od.com/2011/system-replacement-for-istest-apex-method#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Wed, 23 Feb 2011 21:31:19 +0000</pubDate>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Winter 11]]></category>
		<category><![CDATA[New Features]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1202</guid>

					<description><![CDATA[<p>Sometimes we have to write code that executes differently if the Apex is being tested. For a great example, check out Scott Hemmeter's blog post on testing webservice callouts at http://sfdc.arrowpointe.com/2009/05/01/testing-http-callouts/. Scott's example works well, and he uses a Boolean isApexTest, running certain code if this is true or false. I used to do something [&#8230;]</p>
<p>The post <a href="https://www.x2od.com/2011/system-replacement-for-istest-apex-method">System Replacement For isTest Apex Method</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes we have to write code that executes differently if the Apex is being tested.  For a great example, check out Scott Hemmeter's
blog post on testing webservice callouts at <a href="http://sfdc.arrowpointe.com/2009/05/01/testing-http-callouts/">http://sfdc.arrowpointe.com/2009/05/01/testing-http-callouts/</a>. </p>
<p>Scott's example works well, and he uses a Boolean <code>isApexTest</code>, running certain code if this is true or false.  I used to do something similar.  </p>
<p>The disadvantage is that one has to declare one more variable, assign a new value to it from the test code (or call a special method from the test code which, in my opinion, negatively impacts code readability), and (if you put your test code in a separate class) declare it as public.  My Java professor would not like this, as he preferred to declare all variables private unless absolutely necessary.  Sure, I could make a private Boolean and a getter, but now we're splitting hairs.</p>
<p>Salesforce has come to the rescue, though, with a <code>test.isRunningTest()</code> method.  Basically, you can use this interchangeably with your <code>isApexTest</code> variable.  </p>
<p>Here's a snippet of code (from Scott's blog post) with the old and new methods:</p>
<pre class="brush: java; title: ; notranslate">
public static boolean isApexTest = false;
public String main(){
    // Build the http request
    // Invoke web service call
    String result = '';
    if (!isApexTest){
        // Make a real callout since we are not running a test
    } else {
        // A test is running
        result = FakeXMLReturnToSimulateResponse;
    }
    return result;
}
</pre>
And now with the new method:
<pre class="brush: java; title: ; notranslate">
public String main(){
    // Build the http request
    // Invoke web service call
    String result = '';
    if (!Test.isRunningTest()){
        // Make a real callout since we are not running a test
    } else {
        // A test is running
        result = FakeXMLReturnToSimulateResponse;
    }
    return result;
}
</pre>
Some among you may want to switch the two so that we don't put a negative method response in the if evaluator, and that's okay too.  <p>The post <a href="https://www.x2od.com/2011/system-replacement-for-istest-apex-method">System Replacement For isTest Apex Method</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2011/system-replacement-for-istest-apex-method/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1202</post-id>	</item>
		<item>
		<title>Salesforce Wallpaper for iPad (by request)</title>
		<link>https://www.x2od.com/2010/salesforce-ipad-wallpaper</link>
					<comments>https://www.x2od.com/2010/salesforce-ipad-wallpaper#comments</comments>
		
		<dc:creator><![CDATA[David Schach]]></dc:creator>
		<pubDate>Fri, 13 Aug 2010 16:38:12 +0000</pubDate>
				<category><![CDATA[Companies]]></category>
		<category><![CDATA[Salesforce]]></category>
		<guid isPermaLink="false">http://www.x2od.com/?p=1140</guid>

					<description><![CDATA[<p>Because he asked so nicely, here's a cloudy iPad wallpaper just for JP Seabury (and anyone else who wants it). Enjoy! (Click on the image to download the full-sized version.)</p>
<p>The post <a href="https://www.x2od.com/2010/salesforce-ipad-wallpaper">Salesforce Wallpaper for iPad (by request)</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Because he <a href="http://www.x2od.com/2010/08/01/new-blackberry-wallpaper.html">asked so nicely</a>, here's a cloudy iPad wallpaper just for <a href="http://forcemonkey.blogspot.com/">JP Seabury</a> (and anyone else who wants it).  Enjoy!</p>
<center>


<div id="attachment_1141" style="width: 235px" class="wp-caption aligncenter"><a href="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2010/08/sfdc_cloud_iPad_1024x768.jpg"><img data-recalc-dims="1" loading="lazy" decoding="async" aria-describedby="caption-attachment-1141" data-attachment-id="1141" data-permalink="https://www.x2od.com/2010/salesforce-ipad-wallpaper/sfdc_lockup_cs3r1-3" data-orig-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2010/08/sfdc_cloud_iPad_1024x768.jpg?fit=768%2C1024&amp;ssl=1" data-orig-size="768,1024" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;sfdc_lockup_cs3R1&quot;}" data-image-title="iPad Salesforce Wallpaper" data-image-description="" data-image-caption="&lt;p&gt;iPad Salesforce Wallpaper (1024&amp;#215;768 at 132dpi)&lt;/p&gt;
" data-medium-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2010/08/sfdc_cloud_iPad_1024x768.jpg?fit=225%2C300&amp;ssl=1" data-large-file="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2010/08/sfdc_cloud_iPad_1024x768.jpg?fit=375%2C500&amp;ssl=1" src="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2010/08/sfdc_cloud_iPad_1024x768-225x300.jpg?resize=225%2C300" alt="iPad Salesforce Wallpaper" title="iPad Salesforce Wallpaper" width="225" height="300" class="size-medium wp-image-1141" srcset="https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2010/08/sfdc_cloud_iPad_1024x768.jpg?resize=225%2C300&amp;ssl=1 225w, https://i0.wp.com/www.x2od.com/wp/wp-content/uploads/2010/08/sfdc_cloud_iPad_1024x768.jpg?w=768&amp;ssl=1 768w" sizes="auto, (max-width: 225px) 100vw, 225px" /></a><p id="caption-attachment-1141" class="wp-caption-text">iPad Salesforce Wallpaper (1024x768 at 132dpi)</p></div></center>
<p>(Click on the image to download the full-sized version.)</p>

<p>The post <a href="https://www.x2od.com/2010/salesforce-ipad-wallpaper">Salesforce Wallpaper for iPad (by request)</a> appeared first on <a href="https://www.x2od.com">X-Squared On Demand</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.x2od.com/2010/salesforce-ipad-wallpaper/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1140</post-id>	</item>
	</channel>
</rss>
