<?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: SharePoint Programmatically: Provisioning Lookup Fields</title>
	<atom:link href="http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/</link>
	<description>Innovation Matters &#124; SharePoint Server MVP</description>
	<lastBuildDate>Sat, 13 Mar 2010 20:31:23 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Marc Baye</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-37529</link>
		<dc:creator>Marc Baye</dc:creator>
		<pubDate>Tue, 15 Dec 2009 11:51:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-37529</guid>
		<description>Pedro and Michhes are nearly right ;)
Lookups can be provisioned in the schema.xml using the URL atribute of the list where it should be linked, using the &quot;Lists/ListName&quot; form, not only the &quot;ListName&quot;.
Then, when you CREATE the instances using that list template, the lookup fiels will be linked correctly, but:
- Only those lookups that are declared in the schema when you create the list instance, future additions to the schema.xml will create new fields on the list instances but won&#039;t be correctly linked! :(
- The fields instantiated with this way won&#039;t upgrade if any change is made in its declaration in the original schema.xml. i.ex. if you change the format, the display name, or so on, in the schema.xml, other filds will change normally, but these lookups won&#039;t. (it&#039;s like they were customized, but without any versioning activated).

And... I tested it on the SharePoint 2010 beta, so... no good news :(

The programmatically way to link lookups will work always, of course, but will customize the fields too and they won&#039;t upgrade when the schema.xml changes.</description>
		<content:encoded><![CDATA[<p>Pedro and Michhes are nearly right <img src='http://blog.mastykarz.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Lookups can be provisioned in the schema.xml using the URL atribute of the list where it should be linked, using the &#034;Lists/ListName&#034; form, not only the &#034;ListName&#034;.<br />
Then, when you CREATE the instances using that list template, the lookup fiels will be linked correctly, but:<br />
- Only those lookups that are declared in the schema when you create the list instance, future additions to the schema.xml will create new fields on the list instances but won&#039;t be correctly linked! <img src='http://blog.mastykarz.nl/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
- The fields instantiated with this way won&#039;t upgrade if any change is made in its declaration in the original schema.xml. i.ex. if you change the format, the display name, or so on, in the schema.xml, other filds will change normally, but these lookups won&#039;t. (it&#039;s like they were customized, but without any versioning activated).</p>
<p>And&#8230; I tested it on the SharePoint 2010 beta, so&#8230; no good news <img src='http://blog.mastykarz.nl/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>The programmatically way to link lookups will work always, of course, but will customize the fields too and they won&#039;t upgrade when the schema.xml changes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-32356</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Fri, 30 Oct 2009 06:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-32356</guid>
		<description>@Kelly: You&#039;re welcome. Great I could help :)</description>
		<content:encoded><![CDATA[<p>@Kelly: You&#039;re welcome. Great I could help <img src='http://blog.mastykarz.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelly Ford</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-32334</link>
		<dc:creator>Kelly Ford</dc:creator>
		<pubDate>Fri, 30 Oct 2009 02:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-32334</guid>
		<description>Thanks so much for this bit of code.  It has saved me loads of time.</description>
		<content:encoded><![CDATA[<p>Thanks so much for this bit of code.  It has saved me loads of time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michhes</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-24877</link>
		<dc:creator>Michhes</dc:creator>
		<pubDate>Tue, 28 Jul 2009 05:45:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-24877</guid>
		<description>Hopefully this pastes better ;-)

Fields.xml:

&lt;Field 
DisplayName=&quot;Indent Level&quot; 
Description=&quot;&quot; 
Group=&quot;My Cols&quot;
ID=&quot;{05ba7786-ec2b-4d40-bf7c-7fb98d823e1f}&quot;
****List=&quot;Indent Levels&quot;*****
Name=&quot;MyLookup&quot;
Required=&quot;TRUE&quot;
ShowField=&quot;AgendaItemIndentLevel&quot;
Type=&quot;Lookup&quot;
UnlimitedLengthInDocumentLibrary=&quot;FALSE&quot;
/&gt;

Schema.xml:

&lt;Field
DisplayName=&quot;Indent Level&quot;
Description=&quot;&quot;
Group=&quot;My Cols&quot;
ID=&quot;{05ba7786-ec2b-4d40-bf7c-7fb98d823e1f}&quot;
****List=&quot;Indent Levels&quot;****
Name=&quot;MyLookup&quot;
Required=&quot;TRUE&quot;
ShowField=&quot;AgendaItemIndentLevel&quot;
Type=&quot;Lookup&quot;
UnlimitedLengthInDocumentLibrary=&quot;FALSE&quot;
/&gt;</description>
		<content:encoded><![CDATA[<p>Hopefully this pastes better <img src='http://blog.mastykarz.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Fields.xml:</p>
<p>&lt;Field<br />
DisplayName=&quot;Indent Level&quot;<br />
Description=&quot;&quot;<br />
Group=&quot;My Cols&quot;<br />
ID=&quot;{05ba7786-ec2b-4d40-bf7c-7fb98d823e1f}&quot;<br />
****List=&quot;Indent Levels&quot;*****<br />
Name=&quot;MyLookup&quot;<br />
Required=&quot;TRUE&quot;<br />
ShowField=&quot;AgendaItemIndentLevel&quot;<br />
Type=&quot;Lookup&quot;<br />
UnlimitedLengthInDocumentLibrary=&quot;FALSE&quot;<br />
/&gt;</p>
<p>Schema.xml:</p>
<p>&lt;Field<br />
DisplayName=&quot;Indent Level&quot;<br />
Description=&quot;&quot;<br />
Group=&quot;My Cols&quot;<br />
ID=&quot;{05ba7786-ec2b-4d40-bf7c-7fb98d823e1f}&quot;<br />
****List=&quot;Indent Levels&quot;****<br />
Name=&quot;MyLookup&quot;<br />
Required=&quot;TRUE&quot;<br />
ShowField=&quot;AgendaItemIndentLevel&quot;<br />
Type=&quot;Lookup&quot;<br />
UnlimitedLengthInDocumentLibrary=&quot;FALSE&quot;<br />
/&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michhes</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-24876</link>
		<dc:creator>Michhes</dc:creator>
		<pubDate>Tue, 28 Jul 2009 05:43:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-24876</guid>
		<description>Hi Waldek, 

&gt; Are you sure?

Yep, Pedro&#039;s right. You need to ensure the value supplied to the List attribute matches the List attribute on the field definition, otherwise the lookups won&#039;t populate (as per Josh&#039;s post at the above URL).

Fields.xml:

  

      

-Michhes</description>
		<content:encoded><![CDATA[<p>Hi Waldek, </p>
<p>&gt; Are you sure?</p>
<p>Yep, Pedro&#039;s right. You need to ensure the value supplied to the List attribute matches the List attribute on the field definition, otherwise the lookups won&#039;t populate (as per Josh&#039;s post at the above URL).</p>
<p>Fields.xml:</p>
<p>-Michhes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-21880</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Sun, 21 Jun 2009 10:39:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-21880</guid>
		<description>@Pedro Gomes: Are you sure? I just gave it yet another shot: although I was able to provision the field without any errors there was no connectivity to the Lookup List. Are you sure that you didn&#039;t use the cached version of the Field definition as described in comments here: http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx? I&#039;m really curious in your approach.</description>
		<content:encoded><![CDATA[<p>@Pedro Gomes: Are you sure? I just gave it yet another shot: although I was able to provision the field without any errors there was no connectivity to the Lookup List. Are you sure that you didn&#039;t use the cached version of the Field definition as described in comments here: <a href="http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx?" rel="nofollow">http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx?</a> I&#039;m really curious in your approach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pedro Gomes</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-21873</link>
		<dc:creator>Pedro Gomes</dc:creator>
		<pubDate>Sun, 21 Jun 2009 09:21:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-21873</guid>
		<description>That&#039;s not quite true. You can provision list lookup fields using only the Schema file.

The trick is that you can provide the list virtual path in the List attribute. Sharepoint will look for the list and get the ID for you</description>
		<content:encoded><![CDATA[<p>That&#039;s not quite true. You can provision list lookup fields using only the Schema file.</p>
<p>The trick is that you can provide the list virtual path in the List attribute. Sharepoint will look for the list and get the ID for you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-12233</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Fri, 13 Feb 2009 16:51:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-12233</guid>
		<description>That&#039;s challenging indeed: because you add the lookup field programmatically, it&#039;s not in the Content Type while creating the schema.xml. I guess I&#039;d go for programmatically attaching the Content Type to the list.</description>
		<content:encoded><![CDATA[<p>That&#039;s challenging indeed: because you add the lookup field programmatically, it&#039;s not in the Content Type while creating the schema.xml. I guess I&#039;d go for programmatically attaching the Content Type to the list.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raul Queiroga</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-12217</link>
		<dc:creator>Raul Queiroga</dc:creator>
		<pubDate>Fri, 13 Feb 2009 10:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-12217</guid>
		<description>Great post, imagine now one wants to use that content type in a new list definition and that lookup column in one of the list&#039;s views. In the views part of the list schema.xml on has to repeat the content types fields, and in the lookup case it has to have the referenced list ID...having in mind one creates a solution package to aggregate all the features, how caw we set the schema.xml&#039;s lookup column referenced list ID with the ID of the recently created list?</description>
		<content:encoded><![CDATA[<p>Great post, imagine now one wants to use that content type in a new list definition and that lookup column in one of the list&#039;s views. In the views part of the list schema.xml on has to repeat the content types fields, and in the lookup case it has to have the referenced list ID&#8230;having in mind one creates a solution package to aggregate all the features, how caw we set the schema.xml&#039;s lookup column referenced list ID with the ID of the recently created list?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
