<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx</link><description>UPDATE:&amp;#160; In the comments I’ve seen some people saying that this doesn’t work for them.&amp;#160; One thing that I discovered recently is that, in order for this to work, the URL specified in your schema.xml file MUST MATCH the List attribute on all your</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8334789</link><pubDate>Tue, 25 Mar 2008 05:34:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8334789</guid><dc:creator>Chris F.</dc:creator><description>&lt;p&gt;Yay! &amp;nbsp;Thanks for the timely post. &amp;nbsp;I really needed to do this same thing, but I was quite discouraged after reading Bil Simser's blog post from a while back about how he couldn't figure this out. &amp;nbsp;The point your blog post makes that I would probably not have thought to try is that the &amp;quot;List&amp;quot; attribute of the lookup &amp;lt;Field&amp;gt; element is the *url* of the list and not (as the WSS SDK docs say) the name of the list.&lt;/p&gt;
&lt;p&gt;Two thumbs up. &amp;nbsp;Thanks again!&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8374754</link><pubDate>Thu, 10 Apr 2008 15:54:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8374754</guid><dc:creator>Joe B</dc:creator><description>&lt;p&gt;This doesn't clear anything up for me ... where do I put the code you specify?&lt;/p&gt;
&lt;p&gt;Posts that have all the keywords that make google match my searches to your content but don't give me any answers really annoy me.&lt;/p&gt;
&lt;p&gt;Also are these custom fields available in the &amp;quot;in this column&amp;quot; dropdown when looking up a field from one list that resides in another. &amp;nbsp;OOTB custom fields are not available in this dropdown and that sucks.&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8375102</link><pubDate>Thu, 10 Apr 2008 18:07:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8375102</guid><dc:creator>Josh G.</dc:creator><description>&lt;p&gt;Joe B.&lt;/p&gt;
&lt;p&gt;This XML should be in your fields.xml file in your custom list feature definition. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is a lookup column, lookup columns specifically exist to &amp;quot;lookup&amp;quot; values from another list. &amp;nbsp;My use of this column was getting values from a completely custom list.&lt;/p&gt;
&lt;p&gt;I'm sorry that this didn't give you everything you were looking for, if you can post with some more specific questions maybe I can be of more help?&lt;/p&gt;
&lt;p&gt;Hope that helps.&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8495752</link><pubDate>Mon, 12 May 2008 21:06:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8495752</guid><dc:creator>Steve B</dc:creator><description>&lt;p&gt;I tend to agree with your opening comment - I can't quite believe the feature doesn't allow you to provision a Lookup Field without faffing about with feature receivers. &amp;nbsp;However, I've been trying this stuff and not got very far, despite using the relative URL to the new List Instance I've created. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I haven't got the source code to hand right now to post here, but should the List attribute be site relative or web application relative? &amp;nbsp;For instance, my site collection uses a managed path - do I need to include this as well?&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8499427</link><pubDate>Tue, 13 May 2008 11:11:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8499427</guid><dc:creator>Steve B</dc:creator><description>&lt;p&gt;Ok - forget my last post. &amp;nbsp;I've also managed to provision the field using the CAML definition. &amp;nbsp;To confirm a couple of points: &lt;/p&gt;
&lt;p&gt;I entered a dummy value for the List attribute and received an error - on looking at the code where the error was raised I confirmed for myself that the List attribute is resolved when you enter a list name. &amp;nbsp;That was the first step for me as I now knew it was possible using CAML.&lt;/p&gt;
&lt;p&gt;After I returned the List attribute value to show my List Name I then had other problems - the field was provisioned but no lookup was set up so it meant the field was still broken. &amp;nbsp;I pared down the contents of the field definition and was left with the same as Josh mentions above with the ShowField also there. &amp;nbsp;I left ShowField in as I wanted to use the Title field. &amp;nbsp;But, it appears this was the problem. &amp;nbsp;Removing the ShowField attribute (I could not use Title was the link but would have had to use the Title-with-link column instead) fixed it (it defaults to the Title-with-link field).&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8572766</link><pubDate>Wed, 04 Jun 2008 08:44:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8572766</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I am really surprised to see your post since I was searching for a better solution for the same problem. But when I tried your technique, I am getting the following error. Plase let me know where I am making mistake.&lt;/p&gt;
&lt;p&gt;Exception from HRESULT: 0x80040E07 &amp;nbsp; at Microsoft.SharePoint.Library.SPRequestInternalClass.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd) &lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.SharePoint.Library.SPRequest.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd) &lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8572777</link><pubDate>Wed, 04 Jun 2008 08:47:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8572777</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;just putting my element file contents for the reference here...&lt;/p&gt;
&lt;p&gt;&amp;lt;Field ID=&amp;quot;{2FF1B484-6D70-449c-8E5C-904E4D5971E1}&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name=&amp;quot;Master&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Group=&amp;quot;Custom Columns&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type=&amp;quot;Lookup&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DisplayName=&amp;quot;Master&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List=&amp;quot;Lists/Master&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ShowField=&amp;quot;Title&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrependId=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;I have 2 lists named Master and Child and error is getting when I try to add this custom site column to my &amp;quot;child&amp;quot; list.&lt;/p&gt;
&lt;p&gt;I tried modifying the ID attribute also.&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8598124</link><pubDate>Sat, 14 Jun 2008 21:56:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8598124</guid><dc:creator>Peter.dk</dc:creator><description>&lt;p&gt;Get te same error as Nick.....but it works like a dream when I put the guid of the list instead of the lists/mylist in the list attribute.&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8605868</link><pubDate>Mon, 16 Jun 2008 19:06:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8605868</guid><dc:creator>Steve B</dc:creator><description>&lt;p&gt;Further to my last post, it looks like caching had been playing around here and gave the impression that it worked ok. &amp;nbsp;I used the Feature on a separate machine and i did not work. &amp;nbsp;I provisionsed the Field ok, but the connectivity to the require List is just not available. &amp;nbsp;So, basically, it just does not work. &amp;nbsp;Using a GUID works without problem, using a URL never works.&lt;/p&gt;
&lt;p&gt;Although what I posted previously was correct, i.e. the stack trace of the error I got did seem to indicate that the List Name would be resolved, but it hasn't worked like that in practice. &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8720994</link><pubDate>Fri, 11 Jul 2008 14:22:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8720994</guid><dc:creator>Saurabh</dc:creator><description>&lt;p&gt;No Gaffey......It doesn't work for me.......also.....I am using the exact same thing......only one change......&lt;/p&gt;
&lt;p&gt;&amp;lt;Field ID=&amp;quot;myNewGUID&amp;quot; Name=&amp;quot;TestName&amp;quot; Group=&amp;quot;Test Group&amp;quot; Type=&amp;quot;Lookup&amp;quot; DisplayName=&amp;quot;TestDisplayName&amp;quot; List=&amp;quot;Lists/Tests&amp;quot; ShowField=&amp;quot;ID&amp;quot; PrependId=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;but it doesn't show any thing......it shows blank....dropdown....whereas my List has 10 Items.....&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8841036</link><pubDate>Thu, 07 Aug 2008 16:20:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8841036</guid><dc:creator>Nathan</dc:creator><description>&lt;p&gt;Have you tried doing this with a LookupMulti? &amp;nbsp;The list populates, but I am unable to select multiple items on the list.&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8843582</link><pubDate>Fri, 08 Aug 2008 17:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8843582</guid><dc:creator>lzandman</dc:creator><description>&lt;p&gt;@Nathan: Don't use LookupMulti. You have to leave the type to &amp;quot;Lookup&amp;quot; and add an extra attribute Mult=&amp;quot;TRUE&amp;quot; in the Field declaration.&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#8945363</link><pubDate>Thu, 11 Sep 2008 23:08:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8945363</guid><dc:creator>Javier</dc:creator><description>&lt;p&gt;Hi, i get the same error. The problem is that the GUID changes each time the a list is created.&lt;/p&gt;
&lt;p&gt;Check this out:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.sharepointnutsandbolts.com/2007/04/creating-list-based-site-columns-as.html"&gt;http://www.sharepointnutsandbolts.com/2007/04/creating-list-based-site-columns-as.html&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9520034</link><pubDate>Mon, 30 Mar 2009 22:39:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9520034</guid><dc:creator>Vadim Dzyuban</dc:creator><description>&lt;p&gt;Does anybody know if&lt;/p&gt;
&lt;p&gt;is there any way to provision a lookup field and a target lookup list on a separate web apps (not separate sites/site collections) using caml, object model or their combination ?&lt;/p&gt;
&lt;p&gt;I need to provision the same lookup field on multiple user's sites and the data in this lookup should be retrieved from a source lookup list administered on separate web app. It seems that sharepoint does not allow to do that ? &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Vadim &lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9552495</link><pubDate>Thu, 16 Apr 2009 12:32:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9552495</guid><dc:creator>Tested it, doesn't work.</dc:creator><description>&lt;p&gt;hmmm, I've tested as following this article, but it can't bind to the list with the name...is anyone make it works without the list's GUID ?&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9701392</link><pubDate>Fri, 05 Jun 2009 17:37:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9701392</guid><dc:creator>Scott</dc:creator><description>&lt;p&gt;To make this method work, the field definition must exist in a list definition since the wiring up to the GUID happens when you the provision the list, rather than when you add a column to an existing content type/list.&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9701578</link><pubDate>Fri, 05 Jun 2009 19:42:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9701578</guid><dc:creator>xx</dc:creator><description>&lt;p&gt;awesome! &amp;nbsp;I was ommitting the lists/ from list property once i added that it worked.&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9773450</link><pubDate>Thu, 18 Jun 2009 09:48:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9773450</guid><dc:creator>Hoang Ha</dc:creator><description>&lt;p&gt;Thank you very much. It's worked for me&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9850767</link><pubDate>Tue, 28 Jul 2009 11:26:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9850767</guid><dc:creator>Michhes</dc:creator><description>&lt;p&gt;Just echoing your updated text since I missed it when I first skim-read this post:&lt;/p&gt;
&lt;p&gt;&amp;quot;the URL specified in your schema.xml file MUST MATCH the List attribute on all your Field references in field.xml and schema.xml. &amp;nbsp;If these don’t match, it will not work&amp;quot;&lt;/p&gt;
&lt;p&gt;I made these match up and everything worked. &lt;/p&gt;
&lt;p&gt;-Michhes&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9874548</link><pubDate>Tue, 18 Aug 2009 23:45:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9874548</guid><dc:creator>Rafael</dc:creator><description>&lt;p&gt;It DOES work... neat solution! Thanks!&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9894266</link><pubDate>Fri, 11 Sep 2009 19:23:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9894266</guid><dc:creator>Mohamed Hachem</dc:creator><description>&lt;p&gt;Here is an example of the custom lookup column as I added it to a custom list schema &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;Field Type=&amp;quot;LookupMulti&amp;quot; Required=&amp;quot;FALSE&amp;quot; List=&amp;quot;Lists/LookUp&amp;quot; ShowField=&amp;quot;Title&amp;quot; Name=&amp;quot;myLookUp&amp;quot; DisplayName=&amp;quot;myLookUp&amp;quot; Mult=&amp;quot;TRUE&amp;quot; Sortable=&amp;quot;True&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
</description></item><item><title>re: Add SharePoint lookup column declaratively through CAML XML</title><link>http://blogs.msdn.com/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx#9910445</link><pubDate>Wed, 21 Oct 2009 08:44:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9910445</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;I want to add the lookup site column to a content type. The example states how to add it to a list definition but does not seem to work for adding the column to a content type defined in the package.&lt;/p&gt;
&lt;p&gt;Does the content type have to be defined in a feature that activates after the feature that contains the lookup column?&lt;/p&gt;
</description></item></channel></rss>