<?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>ThePointyHeads.com &#187; Custom EditForm</title>
	<atom:link href="http://thepointyheads.com/tag/custom-editform/feed/" rel="self" type="application/rss+xml" />
	<link>http://thepointyheads.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 09:09:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Custom List EditForm &#8211; deploy the easy way</title>
		<link>http://thepointyheads.com/2009/10/custom-list-editform-deploy-the-easy-way/</link>
		<comments>http://thepointyheads.com/2009/10/custom-list-editform-deploy-the-easy-way/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 13:44:43 +0000</pubDate>
		<dc:creator>ciaranc</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Custom EditForm]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[MOSS2007]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SPD]]></category>

		<guid isPermaLink="false">http://thepointyheads.com/2009/10/custom-list-editform-deploy-the-easy-way/</guid>
		<description><![CDATA[Summary: If you want to customise the default forms that come with SharePoint lists (DispForm.aspx, EditForm.aspx, NewForm.aspx) then you should deploy the list as a feature so you can modify the actual file in the 12 hive instead of the unghosted version in the database. This saves you reconfiguring the list in every environment you [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Summary:</strong> </p>
<p>If you want to customise the default forms that come with SharePoint lists (DispForm.aspx, EditForm.aspx, NewForm.aspx) then you should deploy the list as a feature so you can modify the actual file in the 12 hive instead of the unghosted version in the database. This saves you reconfiguring the list in every environment you deploy to which is fantastic for a Dev –&gt; UAT –&gt; Production transition. </p>
<p><strong><strong>Preamble</strong>:</strong></p>
<p>SharePoint features are great for many reasons I won’t go into here&#160; but one that i will.</p>
<p>Most people are already using the SharePoint solution deployment approach but if you’re one of the unconverted, there’s plenty of information out there in google land on how Solutions + WSPBuilder + Powershell = Win.</p>
<p><strong>Setting the Scene:</strong></p>
<p>I recently had to develop a custom SharePoint list. The project structure consisted of:</p>
<ul>
<li>List template Feature </li>
<li>Content Type Feature </li>
<li>Content Type association feature (to join the dots). [Note 1 – if you’re already lost then see Andrew Connell’s blogs on feature deployment] </li>
</ul>
<p>What i wanted to do then was to change the list ‘EditForm.aspx’ and ‘NewForm.aspx’ to be completely custom. So I fired up SharePoint designer and added a DataView webpart.</p>
<p>[Note 2 – there’s many ways to make a hash of this – the way that i find works is this one: <a title="http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/06873fe5-19a9-4b32-91a9-31164afdd4bb" href="http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/06873fe5-19a9-4b32-91a9-31164afdd4bb">http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/06873fe5-19a9-4b32-91a9-31164afdd4bb</a> – i.e. don't delete the ListView webpart, just hide it]</p>
<p>So now i can implement my custom forms in any way i like and add in all kinds of extra functionality. That’s a blog post for another time though.</p>
<p><strong>The issue:</strong></p>
<p><strong>As the form is now unghosted (i.e. it has been customised from the list definition [filesystem] so it exists in the database), all form changes need to be done in SharePoint Designer and will have to be repeated every time you redeploy the list.</strong></p>
<p>There’s other reasons why you shouldn’t unghost pages – performance (not precompiled), potential upgrade problems, etc..</p>
<p><strong>Is using SPD in each environment so bad?</strong></p>
<p>It’s not terrible, it just takes a lot longer, is easier to make a mess of and I don’t like the SPD development environment either. i just find it slow and annoying. After all, it is doing round trips to the database every time you call or save a page. And it often attempts to nanny you by ‘cleaning up’ your HTML behind the scenes. The most obvious example of this is the removal of the ‘~’ character in relative URLs as it attempts to resolve these as absolute.</p>
<p>So I&#8217;d rather work in a proper code editor environment and have my changes directly applied.</p>
<p><strong>The Solution:</strong></p>
<p>As you’ve probably worked out by now, it’s by making sure your pages never get unghosted. </p>
<p>The key to this is to deploy your list feature as normal, but <u><strong>make changes to the EditForm.aspx directly in the list definition feature in the 12 hive</strong></u>.</p>
<p>How to do this is to use SPD on your dev environment, get the page exactly how you want it and then go deploy the feature. </p>
<p>As SharePoint feature GUIDs are non-deterministic (sigh) the instance of the list you create will have a random GUID which you won’t know at this point. It simple become a cut and paste exercise to get the new list GUID and insert it in your EditForm to replace the existing one.</p>
<p>The easiest way to get the list GUID is:</p>
<p>Site Actions –&gt; Site Settings –&gt; Audience Targetting Settings</p>
<p>The URL will now show you the list GUID in a non-html encoded format:</p>
<p><a href="http://thepointyheads.com/wp-content/uploads/2009/10/image.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="23" alt="image" src="http://thepointyheads.com/wp-content/uploads/2009/10/image_thumb.png" width="244" border="0" /></a> </p>
<p>And voila! You can now deploy this list to any environment as many times as you like and the only manual work is to replace the GUID once the list instance has been created! 2 words – AweSome.</p>
]]></content:encoded>
			<wfw:commentRss>http://thepointyheads.com/2009/10/custom-list-editform-deploy-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
