<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Hacking a Salesforce.com Autonumber Field for Importing</title>
	<atom:link href="http://blog.jeffdouglas.com/2009/07/23/hacking-a-salesforce-autonumber-field-for-importing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jeffdouglas.com/2009/07/23/hacking-a-salesforce-autonumber-field-for-importing/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=hacking-a-salesforce-autonumber-field-for-importing</link>
	<description>Get your head out of your #@! and into the clouds!</description>
	<lastBuildDate>Wed, 08 Feb 2012 07:57:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: James</title>
		<link>http://blog.jeffdouglas.com/2009/07/23/hacking-a-salesforce-autonumber-field-for-importing/comment-page-1/#comment-208</link>
		<dc:creator>James</dc:creator>
		<pubDate>Fri, 06 Nov 2009 21:10:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1045#comment-208</guid>
		<description>I agree with the prior comment. Sure you got around the compiler, but once you save the object it will error on you (I tried with an update triggers). The name field is not editable.</description>
		<content:encoded><![CDATA[<p>I agree with the prior comment. Sure you got around the compiler, but once you save the object it will error on you (I tried with an update triggers). The name field is not editable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Waite</title>
		<link>http://blog.jeffdouglas.com/2009/07/23/hacking-a-salesforce-autonumber-field-for-importing/comment-page-1/#comment-207</link>
		<dc:creator>Andrew Waite</dc:creator>
		<pubDate>Thu, 23 Jul 2009 06:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=1045#comment-207</guid>
		<description>I certainly understand and appreciate the desire to minimize code management for seemingly benign administrative changes to field metadata but this approach should be used sparingly, if at all.

One of the great benefits of the strong typing of Apex is system integrity enforcement.  By dropping to use of dynamic Apex you lose this tremendous benefit.

In your sample above you are putting a value into the sobject - presumably for later insert or update. If the field is an autonumber this code will actually fail at runtime because autonumbers are not editable - something the compiler tells you long before the code is ever deployed in the case of a static reference.

Given the current restrictions around the standard name field on custom objects this approach is seemingly benign when the reference in code is read-only, i.e. there is no attempt to insert/update/upsert the value but this is a special case.

If the pattern continues and is applied to custom fields then there is no stopping anyone with appropriate permissions from unknowingly renaming or deleting the field and thus breaking the code that depends on it.

Dynamic Apex is meant for use by code that is unaware of what it needs at compile time.</description>
		<content:encoded><![CDATA[<p>I certainly understand and appreciate the desire to minimize code management for seemingly benign administrative changes to field metadata but this approach should be used sparingly, if at all.</p>
<p>One of the great benefits of the strong typing of Apex is system integrity enforcement.  By dropping to use of dynamic Apex you lose this tremendous benefit.</p>
<p>In your sample above you are putting a value into the sobject &#8211; presumably for later insert or update. If the field is an autonumber this code will actually fail at runtime because autonumbers are not editable &#8211; something the compiler tells you long before the code is ever deployed in the case of a static reference.</p>
<p>Given the current restrictions around the standard name field on custom objects this approach is seemingly benign when the reference in code is read-only, i.e. there is no attempt to insert/update/upsert the value but this is a special case.</p>
<p>If the pattern continues and is applied to custom fields then there is no stopping anyone with appropriate permissions from unknowingly renaming or deleting the field and thus breaking the code that depends on it.</p>
<p>Dynamic Apex is meant for use by code that is unaware of what it needs at compile time.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

