<?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>Integrating Radi with SharePoint and Dynamics CRM</title>
	<atom:link href="http://vspug.com/radi/feed/" rel="self" type="application/rss+xml" />
	<link>http://vspug.com/radi</link>
	<description>Just another VSPUG - Virtual SharePoint User Group weblog</description>
	<lastBuildDate>Mon, 13 Apr 2009 10:09:44 +0000</lastBuildDate>
	<generator>http://vspug.com?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Error in Visual Studio: .NET Runtime version 2.0.50727.3053 &#8211; Fatal Execution Engine Error</title>
		<link>http://vspug.com/radi/2009/04/13/error-in-visual-studio-net-runtime-version-2-0-50727-3053-fatal-execution-engine-error/</link>
		<comments>http://vspug.com/radi/2009/04/13/error-in-visual-studio-net-runtime-version-2-0-50727-3053-fatal-execution-engine-error/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 10:09:44 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[My IDE was crashing when building a project. The only trace of an error was the Event Log. I didn&#39;t find my answer searching around the net, but managed to guess that ReSharper was responsible for it. I disabled it in the IDE and now everything is ok.
&#160;
It crashes on VSTO project templates, I was [...]]]></description>
			<content:encoded><![CDATA[<p>My IDE was crashing when building a project. The only trace of an error was the Event Log. I didn&#39;t find my answer searching around the net, but managed to guess that ReSharper was responsible for it. I disabled it in the IDE and now everything is ok.</p>
<p>&#160;</p>
<p>It crashes on VSTO project templates, I was working on an Outlook add-in with WPF. strange. Has anyone else experienced this?</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/04/13/error-in-visual-studio-net-runtime-version-2-0-50727-3053-fatal-execution-engine-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE8: Disabling the loopback check, 401.1 Unauthorized: Logon Failed</title>
		<link>http://vspug.com/radi/2009/04/10/ie8-disabling-the-loopback-check-401-1-unauthorized-logon-failed/</link>
		<comments>http://vspug.com/radi/2009/04/10/ie8-disabling-the-loopback-check-401-1-unauthorized-logon-failed/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 04:23:00 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Dammit, today I couldn&#8217;t log onto SSP or any other host header site from inside my dev VPC. 
I usually use host headers when I create SharePoint web applications on my development VPC&#8217;s. I create a loopback entry in the hosts file to direct the FQDN to the current server. 
Today I wanted to check [...]]]></description>
			<content:encoded><![CDATA[<p>Dammit, today I couldn&rsquo;t log onto SSP or any other host header site from inside my dev VPC. </p>
<p>I usually use host headers when I create SharePoint web applications on my development VPC&rsquo;s. I create a loopback entry in the hosts file to direct the FQDN to the current server. </p>
<p>Today I wanted to check out the IE Developer Tools that come in IE8, so I installed it on my VPC. I specifically unticked the option asking if Windows Updates should be installed &ndash; I did not want anything other than IE8.</p>
<p>So I fired it up, used it a bit on <a href="http://servername:80">http://servername:80</a>, then tried to log in SSP (<a href="http://mysites/servername:80">http://mysites/servername:80</a>). The credentials kept getting rejected. I checked things like site collection admins, app pool accounts, even recreated the SSP. Still no luck login in.</p>
<p>I noticed the following in the Event Log:</p>
<p><a href="/oldweblogfiles/radi/clip_image001_17F1CE20.png"><img border="0" width="529" src="/oldweblogfiles/radi/clip_image001_thumb_67E77C9E.png" alt="clip_image001" height="133" style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px;" title="clip_image001" /></a></p>
<p>There was an Audit Failure immediately after an Audit Success entry. Here&rsquo;s the failure error:</p>
<div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;">
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;">An account failed to log on.

Subject:
    Security ID:        NULL SID
    Account Name:        -
    Account Domain:        -
    Logon ID:        0x0

Logon Type:            3

Account For Which Logon Failed:
    Security ID:        NULL SID
    Account Name:        administrator
    Account Domain:        mysites.mossdev2008

Failure Information:
    Failure Reason:        An Error occured during Logon.
    Status:            0xc000006d
    Sub Status:        0x0

Process Information:
    Caller Process ID:    0x0
    Caller Process Name:    -

Network Information:
    Workstation Name:    MOSSDEV2008
    Source Network Address:    127.0.0.1
    Source Port:        49329

Detailed Authentication Information:
    Logon Process:
    Authentication Package:    NTLM
    Transited Services:    -
    Package Name (NTLM only):    -
    Key Length:        0</pre>
</div>
<p>I got a hint that the credentials are passing through the first time, but then the error appears. My guess was that IE8 did something, or it has some security feature I am not aware of. I launched Firefox and as I thought, logged into SSP successfully. Damn IE8, I haven&rsquo;t even started using it yet.</p>
<p>&nbsp;After some searching on the net I found the following resources describing the problem. I disabled the loopback check. </p>
<ul>
<li><a href="http://www.21apps.com/sharepoint/ie8-beta-2-ntlm-4011-not-good-for-sharepoint-developers/">IE8 Beta 2 &#8211; NTLM 401.1 (Not good for SharePoint developers)</a></li>
<li><a href="http://geekswithblogs.net/kjones/archive/2009/02/26/129695.aspx">401.1 Unauthorized error on SharePoint dev VPC after installing IE8 Beta 2</a></li>
<li>and resolutions from my colleagues Brian Farnhill and Ishai Sagi: <a href="http://blog.brianfarnhill.com/2008/11/19/ie8-beta-2-authentication-issues-with-host-header-configured-sites/">IE8 beta 2 authentication issues with host header configured sites</a></li>
<li><a href="http://support.microsoft.com/default.aspx/kb/896861" title="http://support.microsoft.com/default.aspx/kb/896861">http://support.microsoft.com/default.aspx/kb/896861</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/04/10/ie8-disabling-the-loopback-check-401-1-unauthorized-logon-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Lookup Field Definitions: writing code to perform the wire-up</title>
		<link>http://vspug.com/radi/2009/04/10/custom-lookup-field-definitions-writing-code-to-perform-the-wire-up/</link>
		<comments>http://vspug.com/radi/2009/04/10/custom-lookup-field-definitions-writing-code-to-perform-the-wire-up/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 23:43:00 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is the second time I run into this &#8211; writing a feature that creates a custom content type that has a custom lookup field. The field is defined as below:


   1: &#60;Field
   2:   ID=&#34;createguid&#34;
   3:   Type=&#34;Lookup&#34;
   4:   StaticName=&#34;Reference&#34;
   [...]]]></description>
			<content:encoded><![CDATA[<p>This is the second time I run into this &ndash; writing a feature that creates a custom content type that has a custom lookup field. The field is defined as below:</p>
<div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;">
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Field</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   2:</span>   <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;createguid&quot;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   3:</span>   <span style="color:#ff0000;">Type</span><span style="color:#0000ff;">=&quot;Lookup&quot;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   4:</span>   <span style="color:#ff0000;">StaticName</span><span style="color:#0000ff;">=&quot;Reference&quot;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   5:</span>   <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;Reference&quot;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   6:</span>   <span style="color:#ff0000;">DisplayName</span><span style="color:#0000ff;">=&quot;Reference&quot;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   7:</span>   <span style="color:#ff0000;">AllowMultiVote</span><span style="color:#0000ff;">=&quot;TRUE&quot;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   8:</span>   <span style="color:#ff0000;">Required</span><span style="color:#0000ff;">=&quot;TRUE&quot;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   9:</span>   <span style="color:#ff0000;">FillInChoice</span><span style="color:#0000ff;">=&quot;FALSE&quot;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  10:</span>   <span style="color:#ff0000;">Group</span><span style="color:#0000ff;">=&quot;Custom Fields&quot;</span>      </pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  11:</span>   <span style="color:#ff0000;">SourceID</span><span style="color:#0000ff;">=&quot;{B45D7C95-C01B-4338-B0AF-88FFA4F3A5F1}&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  12:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Field</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
</div>
<p>Notice the missing <strong>List</strong> and <strong>ShowField</strong> and <strong>WebID</strong> attributes. </p>
<p>When creating a redeployable solution you don&rsquo;t know the GUID of a site or web that gets created during deployment &ndash; it is different every time, but the lookup field needs to know the web that contains the target list.. Simply specifying the <strong>List</strong> attribute with a URL is not enough &ndash; it did not work for me even when I had the ShowField attribute.</p>
<p>The only way I could get the lookup field to work is to run code that updates the field properties after the field and web objects are created. Of particular interest are the <strong>LookupList</strong>, <strong>LookupField</strong> and <strong>LookupWebId </strong>properties of the SPFieldLookup class. I placed the code in a FeatureActivated method.</p>
<p>&nbsp;</p>
<p>Here is the feature activated code that does this:</p>
<div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;">
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">private</span> Guid _myFieldGuid = <span style="color:#0000ff;">new</span> Guid(<span style="color:#006080;">&quot;createguid&quot;</span>);</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   2:</span>&nbsp; </pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   3:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">void</span> FeatureActivated(SPFeatureReceiverProperties properties)</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   4:</span> {</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">try</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   6:</span>     {</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   7:</span>         <span style="color:#008000;">// get web but DO NOT dispose as it belongs to SP</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   8:</span>         SPWeb web = properties.Feature.Parent <span style="color:#0000ff;">as</span> SPWeb;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   9:</span>&nbsp; </pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  10:</span>         <span style="color:#008000;">//get reference to the field and cast as SPFieldLookup</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  11:</span>         SPFieldLookup myField = web.Site.RootWeb.Fields[_myFieldGuid] <span style="color:#0000ff;">as</span> SPFieldLookup;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  12:</span>         </pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  13:</span>         <span style="color:#008000;">//set properties</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  14:</span>         myField.AllowMultipleValues = <span style="color:#0000ff;">true</span>;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  15:</span>         myField.PushChangesToLists = <span style="color:#0000ff;">true</span>;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  16:</span>&nbsp; </pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  17:</span>         myField.LookupWebId = web.ID;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  18:</span>         myField.LookupList = web.Lists[<span style="color:#006080;">&quot;Reference&quot;</span>].ID.ToString();</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  19:</span>         myField.LookupField = <span style="color:#006080;">&quot;Title&quot;</span>;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  20:</span>&nbsp; </pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  21:</span>         <span style="color:#008000;">//call Update to save changes</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  22:</span>         myField.Update();</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  23:</span>     }</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  24:</span>     <span style="color:#0000ff;">catch</span> (SPException ex)</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  25:</span>     {</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  26:</span>         <span style="color:#008000;">//do something here</span></pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  27:</span>     }</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  28:</span> }</pre>
</div>
</div>
<p>&nbsp;</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/04/10/custom-lookup-field-definitions-writing-code-to-perform-the-wire-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Content Type Definitions: RemoveFieldRef ID&#039;s are case sensitive</title>
		<link>http://vspug.com/radi/2009/04/10/content-type-definitions-removefieldref-id-s-are-case-sensitive/</link>
		<comments>http://vspug.com/radi/2009/04/10/content-type-definitions-removefieldref-id-s-are-case-sensitive/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 23:10:09 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I was working on some pretty basic custom content types inheriting from the OOTB WSS content types. My child content types had to remove some fields from the parent content types. Here is an example:
Lets say you are inheriting from the OOTB &#8220;Event&#8221; content type. In it&#39;s schema it includes a &#8220;Recurrence&#8221; field (fRecurrence). This [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on some pretty basic custom content types inheriting from the OOTB WSS content types. My child content types had to remove some fields from the parent content types. Here is an example:</p>
<p>Lets say you are inheriting from the OOTB &#8220;Event&#8221; content type. In it&#39;s schema it includes a &#8220;Recurrence&#8221; field (fRecurrence). This field has the following GUID: {F2E63656-135E-<strong>4f1c</strong>-8FC2-CCBE74071901}<strong> </strong>(notice the GUID is in retarded case.)</p>
<p>To create a child content type that inherits from &#8220;Event&#8221; but excludes the &#8220;Recurrence&#8221; field, you have to add the following in your custom content type definition (my example excludes some other fields):</p>
<div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;">
<div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;">
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ContentType</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;Custom Event&quot;</span> <span style="color:#ff0000;">Group</span><span style="color:#0000ff;">=&quot;Events&quot;</span> <span style="color:#ff0000;">Description</span><span style="color:#0000ff;">=&quot;&quot;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   2:</span>     ID=&quot;</span><span style="color:#ff0000;">0x010200603E1A38891D40ba9CD81AB1A4A62049</span>&quot;<span style="color:#0000ff;">&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   3:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FieldRefs</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   4:</span>       <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RemoveFieldRef</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;{f2e63656-135e-4f1c-8fc2-ccbe74071901}&quot;</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;fRecurrence&quot;</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   5:</span>       <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RemoveFieldRef</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;{7D95D1F4-F5FD-4A70-90CD-B35ABC9B5BC8}&quot;</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;fAllDayEvent&quot;</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   6:</span>       <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RemoveFieldRef</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;{9da97a8a-1da5-4a77-98d3-4bc10456e700}&quot;</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;Comments&quot;</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   7:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">FieldRefs</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   8:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">ContentType</span><span style="color:#0000ff;">&gt;</span></pre>
</p></div>
</div>
<p>The catch is that RemoveFieldRef ID&#39;s are <em><strong>_sometimes_</strong></em> case sensitive. The ID must either be the same case as the GUID defined in the Field XML schema definition, or specifically <strong>LOWER case</strong>. This will not work:</p>
<div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;">
<div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;">
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ContentType</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;Custom Event&quot;</span> <span style="color:#ff0000;">Group</span><span style="color:#0000ff;">=&quot;Events&quot;</span> <span style="color:#ff0000;">Description</span><span style="color:#0000ff;">=&quot;&quot;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   2:</span>     ID=&quot;</span><span style="color:#ff0000;">0x010200603E1A38891D40ba9CD81AB1A4A62049</span>&quot;<span style="color:#0000ff;">&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   3:</span>   <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FieldRefs</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   4:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RemoveFieldRef</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;{f<strong>2E6</strong>3656-<strong>135E</strong>-4f1c-8fc2-<strong>cCb</strong>e74071901}&quot;</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;fRecurrence&quot;</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RemoveFieldRef</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;{7D95D1F4-F5FD-4A70-90CD-<strong>B35abc9B5BC8</strong>}&quot;</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;fAllDayEvent&quot;</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   6:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">RemoveFieldRef</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;{<strong>9dA97a8a</strong>-1<strong>DA</strong>5-4a77-98d3-4<strong>BC</strong>10456e700}&quot;</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=&quot;Comments&quot;</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   7:</span>   <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">FieldRefs</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   8:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">ContentType</span><span style="color:#0000ff;">&gt;</span></pre>
</p></div>
</div>
<p>Crazy GUID fiasco!!! </p>
<ul>
<li>The &#8220;Recurrance&#8221; field does not get removed.</li>
<li>The &#8220;All Day Event&#8221; field gets removed. You can use any case for this (WTF?!?)</li>
<li>The &#8220;Comments&#8221; field (Description) also does not get removed. It is identified as {9da97a8a-1da5-4a77-98d3-4bc10456e700}, and you have to use lower case to remove it.</li>
</ul>
<p>Inconsistent, or I am just missing the point. I&#39;ve done some tests, but I still haven&#39;t found the reason as to why some fields need special cases for their GUID&#39;s. I am very keen to hear about other experiences on this. Very interested to know the actual reason for this, or whether it is a bug.</p>
<p>
</p>
<p>&#160;</p>
<p><strong>Conclusion:</strong></p>
<p>If you are defining custom content types and you want to reorder or remove some fields from the parent (they always inherit), watch out for the case of the GUIDs. If you are getting duplicates, chances are your RemoveFieldRef ID&#39;s should be lower case (or the same case as in the field schema).</p>
<p>Hope this saves some hours.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/04/10/content-type-definitions-removefieldref-id-s-are-case-sensitive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Outlook Email comments: my new favourite feature</title>
		<link>http://vspug.com/radi/2009/03/23/outlook-email-comments-my-new-favourite-feature/</link>
		<comments>http://vspug.com/radi/2009/03/23/outlook-email-comments-my-new-favourite-feature/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 23:09:00 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I discovered this today while copy/pasting sections of a MS Word document with comments. Outlook emails can also have comments.
Ever replied to someone&#8217;s email and commented between his/her lines, then changed the colour of your additions so they stand out? How boring&#8230; check this out:
If you are typing an HTML email, CTRL-ALT-M adds a comment [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered this today while copy/pasting sections of a MS Word document with comments. Outlook emails can also have comments.</p>
<p>Ever replied to someone&rsquo;s email and commented between his/her lines, then changed the colour of your additions so they stand out? How boring&hellip; check this out:</p>
<p>If you are typing an HTML email, <strong>CTRL-ALT-M</strong> adds a comment just like in Microsoft Office Word:</p>
<p><a href="/oldweblogfiles/radi/clip_image001_0A75B07F.png"><img border="0" width="426" src="/oldweblogfiles/radi/clip_image001_thumb_108CD74D.png" alt="clip_image001" height="311" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /> </a></p>
<p>&nbsp;I wish I knew this a year ago! The thing is&hellip; I can&rsquo;t find it in the ribbon bar. bugger.</p>
<p>&nbsp;And today @<a target="_blank" href="https://twitter.com/merill">merill</a> showed me something else&hellip; automatically defining a prefix for your inline comments on reply: </p>
<p><a href="/oldweblogfiles/radi/clip_image0016_5B9FD20F.png"><img border="0" width="435" src="/oldweblogfiles/radi/clip_image0016_thumb_60A20FBE.png" alt="clip_image001" height="195" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" title="clip_image001" /></a></p>
<p>To configure this, go to Outlook, click the <strong>Tools</strong> toolbar, select <strong>Options. </strong>Click th<strong>e Email Options&hellip; </strong>button and find the &ldquo;Mark my comments with:&rdquo; settings:</p>
<p><a href="/oldweblogfiles/radi/clip_image00110_7E33EABD.png"><img border="0" width="355" src="/oldweblogfiles/radi/clip_image00110_thumb_5BFBDF37.png" alt="clip_image001[10]" height="382" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" title="clip_image001[10]" /></a></p>
<p>&nbsp;Awesome stuff, no more hard times in replying to bullet point emails.</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/03/23/outlook-email-comments-my-new-favourite-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online Xpath expression testing tool</title>
		<link>http://vspug.com/radi/2009/03/18/online-xpath-expression-testing-tool/</link>
		<comments>http://vspug.com/radi/2009/03/18/online-xpath-expression-testing-tool/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 00:23:06 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[If you don&#39;t do Xpath stuff all the time you might not have a handy helper tool near by. I had to quickly test an expression today, here is what I used: http://www.mizar.dk/XPath/Default.aspx
Did the job!
]]></description>
			<content:encoded><![CDATA[<p>If you don&#39;t do Xpath stuff all the time you might not have a handy helper tool near by. I had to quickly test an expression today, here is what I used: <a title="http://www.mizar.dk/XPath/Default.aspx" href="http://www.mizar.dk/XPath/Default.aspx">http://www.mizar.dk/XPath/Default.aspx</a></p>
<p>Did the job!</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/03/18/online-xpath-expression-testing-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Content Query Web Part: filtering on a text field &#8211; removing results with blank or null values</title>
		<link>http://vspug.com/radi/2009/03/17/content-query-web-part-filtering-on-a-text-field-removing-results-with-blank-or-null-values/</link>
		<comments>http://vspug.com/radi/2009/03/17/content-query-web-part-filtering-on-a-text-field-removing-results-with-blank-or-null-values/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 23:13:44 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[This should be an easy pick for developers. When you want to query items and omit results that have a blank or null value in a text field, simply use the greater than 0 filter chaining operator.

 &#8220;Computer Network Name&#8221; is a text field in my example. I want to only return results when that [...]]]></description>
			<content:encoded><![CDATA[<p>This should be an easy pick for developers. When you want to query items and omit results that have a blank or null value in a text field, simply use the greater than 0 filter chaining operator.</p>
<p><a href="/oldweblogfiles/radi/clip_image001_26C4DA94.png"><img title="clip_image001" style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px;" height="123" alt="clip_image001" src="/oldweblogfiles/radi/clip_image001_thumb_4CBA8AEA.png" width="230" border="0" /></a></p>
<p> &#8220;Computer Network Name&#8221; is a text field in my example. I want to only return results when that field has values.  </p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/03/17/content-query-web-part-filtering-on-a-text-field-removing-results-with-blank-or-null-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Content Query Web Part: querying by content type, grouping results by the parent list</title>
		<link>http://vspug.com/radi/2009/03/17/content-query-web-part-querying-by-content-type-grouping-results-by-the-parent-list/</link>
		<comments>http://vspug.com/radi/2009/03/17/content-query-web-part-querying-by-content-type-grouping-results-by-the-parent-list/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 06:33:00 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Consider the following scenario :

An existing content type spread across multiple lists
A CQWP is required to query the items of that content type and group the results by the list which they belong to
The group headings have to be links to the actual list
There should be no visible change to the existing stuff
There is an [...]]]></description>
			<content:encoded><![CDATA[<p>Consider the following scenario :</p>
<ul>
<li>An existing content type spread across multiple lists</li>
<li>A CQWP is required to query the items of that content type and group the results by the list which they belong to</li>
<li>The group headings have to be links to the actual list</li>
<li>There should be no visible change to the existing stuff</li>
<li>There is an existing ItemAdded event handler attached to the content type</li>
</ul>
<p>The challenge is, that by default the items returned from the CQWP don&rsquo;t actually know much more about the parent list apart from the ListID that is returned as an attribute of the row element. You would think the list guid is all you need to identify the list instance, which it completely is, but since you are rendering XML with XSL Style Sheets, you don&rsquo;t really have much flexibility in pulling actual information about that list.</p>
<p>I had a browse around the net to see how other people get the parent list name of row items &#8211; the most viable approach was the event handler. Since the already released version of the solution had an event receiver against the content type, my best option was to modify it to give me some information about the parent list.</p>
<ul>
<li>I added two hidden fields to the content type to satisfy the &ldquo;no visible change&rdquo; requirement &ndash; one for the list name and the other for the list URL (site collection relative).</li>
<li>I modified the event handler to populate them</li>
</ul>
<p>The next challenge was that the CQWP won&rsquo;t see the hidden fields in the UI, so I had to set them manually.</p>
<p>The following properties inside the .webpart file of my CQWP allows me to add those fields to the grouping functionality of the web part:</p>
<div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;">
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   1:</span> &lt;property name=<span style="color:#006080;">&quot;AdditionalGroupAndSortFields&quot;</span> type=<span style="color:#006080;">&quot;string&quot;</span>&gt;ParentListName;ParentListUrl&lt;/property&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   2:</span> &lt;property name=<span style="color:#006080;">&quot;CommonViewFields&quot;</span> type=<span style="color:#006080;">&quot;string&quot;</span>&gt;ParentListName, Text;ParentListUrl, Text&lt;/property&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   3:</span> &lt;property name=<span style="color:#006080;">&quot;GroupBy&quot;</span> type=<span style="color:#006080;">&quot;string&quot;</span>&gt;ParentListName&lt;/property&gt;</pre>
</div>
</div>
<p>This MSDN article gives a good explanation on how to use these properties: <a href="http://msdn.microsoft.com/en-us/library/aa981241.aspx" title="http://msdn.microsoft.com/en-us/library/aa981241.aspx">http://msdn.microsoft.com/en-us/library/aa981241.aspx</a></p>
<p>The CommonViewFields property tells the query to return further fields into the row xml. You can reference the values of these inside the XSL. The AdditionalGroupAndSortFields will allow you to set it in the Group By section in the UI.</p>
<p>Here is the template inside my header XSL Style Sheet that renders the group heading as a link:</p>
<div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;">
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   1:</span> &lt;xsl:template name=<span style="color:#006080;">&quot;CustomLinkedHeader&quot;</span> match=<span style="color:#006080;">&quot;*&quot;</span> mode=<span style="color:#006080;">&quot;header&quot;</span>&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   2:</span>   &lt;div <span style="color:#0000ff;">class</span>=<span style="color:#006080;">&quot;groupheader item medium&quot;</span>&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   3:</span>     &lt;a&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   4:</span>       &lt;xsl:attribute name=<span style="color:#006080;">&quot;href&quot;</span>&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   5:</span>         &lt;xsl:<span style="color:#0000ff;">value</span>-of select=<span style="color:#006080;">&quot;@ParentListUrl&quot;</span>/&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   6:</span>       &lt;/xsl:attribute&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   7:</span>     &lt;xsl:call-template name=<span style="color:#006080;">&quot;OuterTemplate.GetGroupName&quot;</span>&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">   8:</span>       &lt;xsl:with-param name=<span style="color:#006080;">&quot;GroupName&quot;</span> select=<span style="color:#006080;">&quot;@*[name()=$Group]&quot;</span>/&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">   9:</span>       &lt;xsl:with-param name=<span style="color:#006080;">&quot;GroupType&quot;</span> select=<span style="color:#006080;">&quot;$GroupType&quot;</span>/&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  10:</span>     &lt;/xsl:call-template&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  11:</span>     &lt;/a&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"><span style="color:#606060;">  12:</span>   &lt;/div&gt;</pre>
<pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"><span style="color:#606060;">  13:</span> &lt;/xsl:template&gt;</pre>
</div>
</div>
<p>The rest of the XSL handles the parent list name automatically. The good thing is that the web part won&rsquo;t display headings where items are not returned as they don&rsquo;t exist in the result set. It also provides you the ability to filter on fields &ndash; great functionality.</p>
<p>That&rsquo;s pretty much it. The CQWP is REALLY powerful, I love it and I now find XSLT stuff really fun too.</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/03/17/content-query-web-part-querying-by-content-type-grouping-results-by-the-parent-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Content Query Web Part: getting a full dump of the raw XML</title>
		<link>http://vspug.com/radi/2009/03/17/content-query-web-part-getting-a-full-dump-of-the-raw-xml/</link>
		<comments>http://vspug.com/radi/2009/03/17/content-query-web-part-getting-a-full-dump-of-the-raw-xml/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 05:02:55 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#39;ve been doing some really cool stuff with the Content Query Web Part (CQWP) lately, so I&#39;m gonna put together a few posts on some of the nice challenges that I had to tackle.
After playing around with XSLT for a while now, I have grown to love it and I think it is awesome and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#39;ve been doing some really cool stuff with the Content Query Web Part (CQWP) lately, so I&#39;m gonna put together a few posts on some of the nice challenges that I had to tackle.</p>
<p>After playing around with XSLT for a while now, I have grown to love it and I think it is awesome and really flexible. When styling the CQWP, you sometimes have to get to the RAW xml data that comes out of it &#8211; it really helps you understand how XSL style sheets work when you have the raw view. In my case, I had to understand how the grouping functionality of the web part works, so I can incorporate it into my XSLT styling (more posts to follow).</p>
<p>The following XSL template dumps the xml for you:</p>
<div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &#39;Courier New&#39;, courier, monospace;height:63px;background-color:#f4f4f4;">
<div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;">
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   1:</span> &lt;xsl:template match=<span style="color:#006080;">&quot;/&quot;</span>&gt;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   2:</span>     &lt;xmp&gt;&lt;xsl:copy-of select=<span style="color:#006080;">&quot;*&quot;</span>/&gt;&lt;/xmp&gt;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   3:</span> &lt;/xsl:template&gt;</pre>
</p></div>
</div>
<p>I place the above in my own &#8220;main&#8221; XSL file of the CQWP &#8211; I never edit the original one created by the Publishing Infrastructure feature called ContentQueryMain.xsl.</p>
<p>I replace the following template call with the 3 lines above:</p>
<div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &#39;Courier New&#39;, courier, monospace;height:62px;background-color:#f4f4f4;">
<div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;">
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   1:</span> &lt;xsl:template match=<span style="color:#006080;">&quot;/&quot;</span>&gt;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   2:</span>   &lt;xsl:call-template name=<span style="color:#006080;">&quot;OuterTemplate&quot;</span> /&gt;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   3:</span> &lt;/xsl:template&gt;</pre>
</p></div>
</div>
<p>I also do a small change to the output tag (the first line after the opening &lt;xsl:stylesheet tag)</p>
<div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &#39;Courier New&#39;, courier, monospace;height:99px;background-color:#f4f4f4;">
<div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;">
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   1:</span> <span style="color:#008000;">//the original:</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   2:</span> &lt;xsl:output method=<span style="color:#006080;">&quot;html&quot;</span> indent=<span style="color:#006080;">&quot;no&quot;</span> /&gt;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   3:</span>&#160; </pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   4:</span> <span style="color:#008000;">//modified</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   5:</span> &lt;xsl:output method=<span style="color:#006080;">&quot;xml&quot;</span> indent=<span style="color:#006080;">&quot;yes&quot;</span> /&gt;</pre>
</p></div>
</div>
<p>This shows me the raw xml in a nice, structured way:</p>
<p><a href="/oldweblogfiles/radi/clip_image001_4332436E.png"><img title="clip_image001" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="191" alt="clip_image001" src="/oldweblogfiles/radi/clip_image001_thumb_653A9F34.png" width="514" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/03/17/content-query-web-part-getting-a-full-dump-of-the-raw-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code snippet: getting the values of a multi-value lookup field or People and Groups field</title>
		<link>http://vspug.com/radi/2009/03/13/code-snippet-getting-the-values-of-a-multi-value-lookup-field-or-people-and-groups-field/</link>
		<comments>http://vspug.com/radi/2009/03/13/code-snippet-getting-the-values-of-a-multi-value-lookup-field-or-people-and-groups-field/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 02:59:36 +0000</pubDate>
		<dc:creator>radi a.</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#39;ve seen a few ways of getting this done, including regular expressions and other stuff. This is a code snippet of how I do it.


   1: /// &#60;summary&#62;
   2: /// Returns a generic collection of the ID and value of a Lookup-Field with multiple values.
   3: /// &#60;/summary&#62;
  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#39;ve seen a few ways of getting this done, including regular expressions and other stuff. This is a code snippet of how I do it.</p>
<div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &#39;Courier New&#39;, courier, monospace;background-color:#f4f4f4;">
<div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;">
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   1:</span> <span style="color:#008000;">/// &lt;summary&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   2:</span> <span style="color:#008000;">/// Returns a generic collection of the ID and value of a Lookup-Field with multiple values.</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   3:</span> <span style="color:#008000;">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   4:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> IDictionary&lt;<span style="color:#0000ff;">int</span>, <span style="color:#0000ff;">string</span>&gt; GetMultiValueLookupFieldItems(<span style="color:#0000ff;">this</span> SPListItem item, Guid fieldGuid)</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   5:</span> {</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   6:</span>     var returnValue = <span style="color:#0000ff;">new</span> Dictionary&lt;<span style="color:#0000ff;">int</span>,<span style="color:#0000ff;">string</span>&gt;();</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   7:</span>&#160; </pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">   8:</span>     <span style="color:#0000ff;">if</span> (item == <span style="color:#0000ff;">null</span>)</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   9:</span>         <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">null</span>;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">  10:</span>     </pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">  11:</span>     var lookupField = item.Fields[fieldGuid];</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">  12:</span>&#160; </pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">  13:</span>     <span style="color:#0000ff;">if</span> (lookupField.FieldValueType == <span style="color:#0000ff;">typeof</span>(SPFieldLookupValueCollection))</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">  14:</span>     {</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">  15:</span>         var lookupFieldValues = item[fieldGuid] <span style="color:#0000ff;">as</span> SPFieldLookupValueCollection;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">  16:</span>         <span style="color:#0000ff;">if</span> (lookupFieldValues == <span style="color:#0000ff;">null</span>)</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">  17:</span>             <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">null</span>;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">  18:</span>         <span style="color:#0000ff;">foreach</span> (var <span style="color:#0000ff;">value</span> <span style="color:#0000ff;">in</span> lookupFieldValues)</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">  19:</span>         {</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">  20:</span>             returnValue.Add(<span style="color:#0000ff;">value</span>.LookupId, <span style="color:#0000ff;">value</span>.LookupValue);</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">  21:</span>         }</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">  22:</span>     }</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">  23:</span>     </pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"><span style="color:#606060;">  24:</span>     <span style="color:#0000ff;">return</span> returnValue;</pre>
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">  25:</span> }</pre>
</p></div>
</div>
<p>To do this for a People or Group/UserMulti field &#8211; the SPFieldUserValueCollection type &#8211; just replace SPFieldLookupValueCollection to SPFieldUserValueCollection.</p>
<p>For something really cool, a generic method with casting at runtime would be really cool to accommodate both situations. I&#39;d be interested on that.</p>
<p>Here is how to use the code:</p>
<div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &#39;Courier New&#39;, courier, monospace;height:31px;background-color:#f4f4f4;">
<div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;">
<pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &#39;Courier New&#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"><span style="color:#606060;">   1:</span> IDictionary&lt;<span style="color:#0000ff;">int</span>, <span style="color:#0000ff;">string</span>&gt; groups = theSPListItemObject.GetMultiValueLookupFieldItems(c_LookupFieldGuid);</pre>
</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/radi/2009/03/13/code-snippet-getting-the-values-of-a-multi-value-lookup-field-or-people-and-groups-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
