<?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 &#124; ISSN 2210-9390</description>
	<lastBuildDate>Thu, 09 Feb 2012 05:22:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-120034</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Wed, 01 Feb 2012 07:16:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-120034</guid>
		<description>@Duncan: You might try to modify the Lookup Field to use the FileRef field instead of Title, although I&#039;m not sure if it&#039;s possible.</description>
		<content:encoded><![CDATA[<p>@Duncan: You might try to modify the Lookup Field to use the FileRef field instead of Title, although I&#039;m not sure if it&#039;s possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duncan</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-119903</link>
		<dc:creator>Duncan</dc:creator>
		<pubDate>Tue, 31 Jan 2012 11:20:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-119903</guid>
		<description>Fantastic Post.  I was wondering if you had any information on how to change the link behaviour of a multi lookup field in a dispform.aspx to open document directly. Need to apply change to custom list definition tamplate. Cheers Duncan</description>
		<content:encoded><![CDATA[<p>Fantastic Post.  I was wondering if you had any information on how to change the link behaviour of a multi lookup field in a dispform.aspx to open document directly. Need to apply change to custom list definition tamplate. Cheers Duncan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sunil Dubey</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-111704</link>
		<dc:creator>Sunil Dubey</dc:creator>
		<pubDate>Wed, 21 Dec 2011 10:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-111704</guid>
		<description>Check out this helpful link too its also having a wonderful explanation on list definition in sharepoint 2010...
http://mindstick.com/Articles/db52b9c2-9775-4899-a1f3-4f85fce9ec32/?List%20Definition%20in%20SharePoint%202010

Thanks</description>
		<content:encoded><![CDATA[<p>Check out this helpful link too its also having a wonderful explanation on list definition in sharepoint 2010&#8230;<br />
<a href="http://mindstick.com/Articles/db52b9c2-9775-4899-a1f3-4f85fce9ec32/?List%20Definition%20in%20SharePoint%202010" rel="nofollow">http://mindstick.com/Articles/db52b9c2-9775-4899-a1f3-4f85fce9ec32/?List%20Definition%20in%20SharePoint%202010</a></p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Davis</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-76801</link>
		<dc:creator>Joshua Davis</dc:creator>
		<pubDate>Fri, 22 Apr 2011 18:58:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-76801</guid>
		<description>Hey it does work.  But, there&#039;s a catch - dependencies. (Darn those little critters.) 

If you have a List 1 that has a lookup field pulling from List 2.  List 2 must be declared and deployed first in your Features.xml so that the GUID is created successfully and assigned to the lookup field in List 1.

I was having a terrible time with this until I realized that list def&#039;s are, by default, deployed in alphabetical order. Thus, the above scenario would fail if I didn&#039;t declare List 2 prior to List 1 in the Features.xml.  

For my real-life case, check out the fist comment on the comments page 3: http://blogs.msdn.com/b/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx?PageIndex=3#comments</description>
		<content:encoded><![CDATA[<p>Hey it does work.  But, there&#039;s a catch &#8211; dependencies. (Darn those little critters.) </p>
<p>If you have a List 1 that has a lookup field pulling from List 2.  List 2 must be declared and deployed first in your Features.xml so that the GUID is created successfully and assigned to the lookup field in List 1.</p>
<p>I was having a terrible time with this until I realized that list def&#039;s are, by default, deployed in alphabetical order. Thus, the above scenario would fail if I didn&#039;t declare List 2 prior to List 1 in the Features.xml.  </p>
<p>For my real-life case, check out the fist comment on the comments page 3: <a href="http://blogs.msdn.com/b/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx?PageIndex=3#comments" rel="nofollow">http://blogs.msdn.com/b/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx?PageIndex=3#comments</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-59885</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Wed, 10 Nov 2010 10:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-59885</guid>
		<description>@Shafaqat: Using Content Types is a good practice in general. It makes it easier to aggregate data, use Workflows, Event Handlers, etc.</description>
		<content:encoded><![CDATA[<p>@Shafaqat: Using Content Types is a good practice in general. It makes it easier to aggregate data, use Workflows, Event Handlers, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shafaqat</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-59862</link>
		<dc:creator>Shafaqat</dc:creator>
		<pubDate>Wed, 10 Nov 2010 05:47:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-59862</guid>
		<description>thanx for your valuable reply.
at the moment i am using is directly with my list but wondering what role content type can play here? Is it just a Good Practice or something else?</description>
		<content:encoded><![CDATA[<p>thanx for your valuable reply.<br />
at the moment i am using is directly with my list but wondering what role content type can play here? Is it just a Good Practice or something else?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-59813</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Tue, 09 Nov 2010 15:29:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-59813</guid>
		<description>@Shafaqat: No you don&#039;t have to add it to a Content Type. You could as well use it directly in a list.</description>
		<content:encoded><![CDATA[<p>@Shafaqat: No you don&#039;t have to add it to a Content Type. You could as well use it directly in a list.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shafaqat</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-59794</link>
		<dc:creator>Shafaqat</dc:creator>
		<pubDate>Tue, 09 Nov 2010 10:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-59794</guid>
		<description>hi 
I have created the lookup filed but y do we need to add in the content type?</description>
		<content:encoded><![CDATA[<p>hi<br />
I have created the lookup filed but y do we need to add in the content type?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-59764</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Tue, 09 Nov 2010 00:53:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-59764</guid>
		<description>@Waldek, I&#039;m not sure about cross-web lookups in 2007, but you can definitely do this in SP2010 - I&#039;ve faced the issues you describe, and have created an extension method based around SPWeb.Fields.AddFieldAsXml(), where I store the element XML as an embedded resource and pass it to my method on FeatureActivated. It works fine:

 - Create a list in the root site,
 - Create a site lookup column in the root site that points to that list,
 - Create a content type in the root site using that site column,
 - Now create a list in a subsite from that content type.</description>
		<content:encoded><![CDATA[<p>@Waldek, I&#039;m not sure about cross-web lookups in 2007, but you can definitely do this in SP2010 &#8211; I&#039;ve faced the issues you describe, and have created an extension method based around SPWeb.Fields.AddFieldAsXml(), where I store the element XML as an embedded resource and pass it to my method on FeatureActivated. It works fine:</p>
<p> &#8211; Create a list in the root site,<br />
 &#8211; Create a site lookup column in the root site that points to that list,<br />
 &#8211; Create a content type in the root site using that site column,<br />
 &#8211; Now create a list in a subsite from that content type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/sharepoint-programmatically-provisioning-lookup-fields/comment-page-1/#comment-57560</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Tue, 12 Oct 2010 05:14:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/2007/09/06/sharepoint-programmatically-provisioning-lookup-fields/#comment-57560</guid>
		<description>@Raghu: by default you can use Lookup Fields only with Lists from the same Web as where the Field is being defined.</description>
		<content:encoded><![CDATA[<p>@Raghu: by default you can use Lookup Fields only with Lists from the same Web as where the Field is being defined.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

