<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2titles.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemtitles.css"?><!--RSS generated by Microsoft SharePoint Foundation RSS Generator on 2/10/2012 3:46:34 AM --><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Blog: Posts</title>
    <link>http://www.schaeflein.net/blog/Lists/Posts/AllPosts.aspx</link>
    <description>RSS feed for the Posts list.</description>
    <lastBuildDate>Fri, 10 Feb 2012 09:46:34 GMT</lastBuildDate>
    <generator>Microsoft SharePoint Foundation RSS Generator</generator>
    <ttl>60</ttl>
    <language>en-US</language>
    <image>
      <title>Blog: Posts</title>
      <url>http://www.schaeflein.net/blog/_layouts/images/siteIcon.png</url>
      <link>http://www.schaeflein.net/blog/Lists/Posts/AllPosts.aspx</link>
    </image>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PaulSchaeflein" /><feedburner:info uri="paulschaeflein" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><item>
      <title>SPFieldCollection.TryGetFieldByStaticName() is inconsistent</title>
      <link>http://feedproxy.google.com/~r/PaulSchaeflein/~3/soJ3Cl2-PsQ/ViewPost.aspx</link>
      <description>&lt;div&gt;&lt;b&gt;Body:&lt;/b&gt; &lt;div class="ExternalClass69C078C0115847FA91CEF3A9EF6C0E2B"&gt;&lt;p&gt;Today’s task required me to check if a column exists on a list, and if not then add it from the site column gallery. Since I knew that SP2010 added a method TryGetList(), I thought I would look around for a similar method for fields.&lt;/p&gt;  &lt;p&gt;Sure enough, I found &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldcollection.trygetfieldbystaticname.aspx"&gt;TryGetFieldByStaticName()&lt;/a&gt; on the SPFieldCollection class. This is exactly what I was looking for. Why it uses the StaticName property instead of the DisplayName (like the Item method does) or the Internal Name (like CAML does) is totally beyond me. But at least I can check for a field without anticipating an exception.&lt;/p&gt;  &lt;p&gt;After hours of digging and bothering people on IM and the twitter, I discovered that TryGetFieldByStaticName() works as you would expect when the SPFieldCollection is based on an SPList object. However, the exact same method based on an SPWeb object (like the site columns gallery) always returns null!&lt;/p&gt;  &lt;p&gt;Here is a snippet that illustrates the problem:&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:0764f522-ed88-4d7b-b86a-e41244ff5c70" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt"&gt; &lt;div style="background:#000080;color:#fff;font-family:Verdana, Tahoma, Arial, sans-serif;font-weight:bold;padding:2px 5px"&gt;TryGetFieldByStaticName sample&lt;/div&gt; &lt;div style="background:#ddd;max-height:500px;overflow:auto"&gt; &lt;ol start="1" style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px;white-space:nowrap"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; AddColumnIfNotPresentOnList(&lt;span style="color:#2b91af"&gt;SPList&lt;/span&gt; list, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; columnName)&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;  &lt;span style="color:#2b91af"&gt;SPField&lt;/span&gt; listField = &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;  &lt;span style="color:#2b91af"&gt;SPField&lt;/span&gt; siteField = &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;;&lt;/li&gt; &lt;li&gt; &lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;  listField = list.Fields.TryGetFieldByStaticName(columnName);&lt;/li&gt; &lt;li&gt;  &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (listField == &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;)&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;  {&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#008000"&gt;// *** this line always returns null ***&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    siteField = list.ParentWeb.Site.RootWeb.Fields.TryGetFieldByStaticName(columnName);&lt;/li&gt; &lt;li&gt; &lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    &lt;span style="color:#008000"&gt;// had to use the following instead...&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;      siteField = list.ParentWeb.Site.RootWeb.Fields[columnName];&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;catch&lt;/span&gt; (&lt;span style="color:#2b91af"&gt;Exception&lt;/span&gt;)&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;      &lt;span style="color:#008000"&gt;// yes, I shudder when writing this code...&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (siteField != &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;)&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;      list.Fields.Add(siteField);&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;  }&lt;/li&gt; &lt;li style="background:#f3f3f3"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;** NOTE **      &lt;br /&gt;The above is an illustration, not working code.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Category:&lt;/b&gt; &lt;a onclick="OpenPopUpPage('http://www.schaeflein.net/blog/_layouts/listform.aspx?PageType=4&amp;ListId={98F99240-B34A-4D5D-818C-B9F8E0C683F8}&amp;ID=1&amp;RootFolder=*', RefreshPage); return false;" href="http://www.schaeflein.net/blog/_layouts/listform.aspx?PageType=4&amp;ListId={98F99240-B34A-4D5D-818C-B9F8E0C683F8}&amp;ID=1&amp;RootFolder=*"&gt;SharePoint 2010&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Published:&lt;/b&gt; 11/29/2011 3:55 PM&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=soJ3Cl2-PsQ:v2rLAB0cYug:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=soJ3Cl2-PsQ:v2rLAB0cYug:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=soJ3Cl2-PsQ:v2rLAB0cYug:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?i=soJ3Cl2-PsQ:v2rLAB0cYug:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=soJ3Cl2-PsQ:v2rLAB0cYug:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?i=soJ3Cl2-PsQ:v2rLAB0cYug:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSchaeflein/~4/soJ3Cl2-PsQ" height="1" width="1"/&gt;</description>
      <author>Paul</author>
      <category>SharePoint 2010</category>
      <pubDate>Tue, 29 Nov 2011 21:55:21 GMT</pubDate>
      <guid isPermaLink="false">http://www.schaeflein.net/blog/Lists/Posts/ViewPost.aspx?ID=8</guid>
    <feedburner:origLink>http://www.schaeflein.net/blog/Lists/Posts/ViewPost.aspx?ID=8</feedburner:origLink></item>
    <item>
      <title>Microsoft Safety Scanner</title>
      <link>http://feedproxy.google.com/~r/PaulSchaeflein/~3/pbLw3X-YVqk/ViewPost.aspx</link>
      <description>&lt;div&gt;&lt;b&gt;Body:&lt;/b&gt; &lt;div class="ExternalClass5DA9AC88181B4A16B000C254A1FC4785"&gt;&lt;p&gt;During the holiday season, most technical people get pressed into service as the IT Department for the family. There always is a PC around that is slow or infected with viruses. Scott Hanselman has discussed this topic frequently, with a &lt;a href="http://www.hanselman.com/blog/TheTechnicalFriendsEssentialMaintenanceChecklistForNonTechnicalFriendsWindowsComputer.aspx"&gt;summary post&lt;/a&gt; being my favorite.&lt;/p&gt;  &lt;p&gt;My Dad’s PC got infected this holiday shopping season. Of course, we can’t pinpoint the exact website, but he thought he was on Amazon. Of course, that is *very* unlikely, but task number one was getting the machine usable. &lt;/p&gt;  &lt;p&gt;He had Norton on the machine (which had expired), but launching the program would not work. It would immediately abort, most likely because the virus was looking for that executable. Same thing with “the internet protector program I got from AOL” and &lt;a href="http://windows.microsoft.com/en-US/windows/products/security-essentials"&gt;Microsoft Security Essentials (MSE)&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;So, I booted the PC into safe mode. The incessant pop-ups stopped, but the Security Essentials program would not run either. Same with Norton. &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none" class="wlEmoticon wlEmoticon-sadsmile" alt="Sad smile" src="/blog/Lists/Posts/Attachments/9/wlEmoticon-sadsmile_2_6F8FC9BA.png" /&gt;&lt;/p&gt;  &lt;p&gt;After some Bing-ing, I found the &lt;a href="http://www.microsoft.com/security/scanner/en-us/default.aspx"&gt;Microsoft Safety Scanner&lt;/a&gt; program. A 72KB executable that runs in safe mode and is refreshed periodically to combat the latest issues. Success!!!! The program expires 10 days after download, so is not a replacement for MSE (or any other AV program). But it discovered and removed viruses on the computer, allowing me to boot normally and remove the failing AV/protector programs. And put MSE on and configure its updates. &lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Category:&lt;/b&gt; &lt;a onclick="OpenPopUpPage('http://www.schaeflein.net/blog/_layouts/listform.aspx?PageType=4&amp;ListId={98F99240-B34A-4D5D-818C-B9F8E0C683F8}&amp;ID=4&amp;RootFolder=*', RefreshPage); return false;" href="http://www.schaeflein.net/blog/_layouts/listform.aspx?PageType=4&amp;ListId={98F99240-B34A-4D5D-818C-B9F8E0C683F8}&amp;ID=4&amp;RootFolder=*"&gt;Miscellaneous&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Published:&lt;/b&gt; 12/21/2011 9:36 AM&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Attachments:&lt;/b&gt; &lt;a href="http://www.schaeflein.net/blog/Lists/Posts/Attachments/9/wlEmoticon-sadsmile_2_6F8FC9BA.png"&gt;http://www.schaeflein.net/blog/Lists/Posts/Attachments/9/wlEmoticon-sadsmile_2_6F8FC9BA.png&lt;/a&gt;&lt;br /&gt;&lt;a href=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=pbLw3X-YVqk:zWCXaNifZZI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=pbLw3X-YVqk:zWCXaNifZZI:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=pbLw3X-YVqk:zWCXaNifZZI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?i=pbLw3X-YVqk:zWCXaNifZZI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=pbLw3X-YVqk:zWCXaNifZZI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?i=pbLw3X-YVqk:zWCXaNifZZI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSchaeflein/~4/pbLw3X-YVqk" height="1" width="1"/&gt;</description>
      <author>Paul</author>
      <category>Miscellaneous</category>
      <pubDate>Wed, 21 Dec 2011 15:36:07 GMT</pubDate>
      <guid isPermaLink="false">http://www.schaeflein.net/blog/Lists/Posts/ViewPost.aspx?ID=9</guid>
    <feedburner:origLink>http://www.schaeflein.net/blog/Lists/Posts/ViewPost.aspx?ID=9</feedburner:origLink></item>
    <item>
      <title>Thoughts about SharePoint Saturdays</title>
      <link>http://feedproxy.google.com/~r/PaulSchaeflein/~3/KqOu4OnYcOs/ViewPost.aspx</link>
      <description>&lt;div&gt;&lt;b&gt;Body:&lt;/b&gt; &lt;div class="ExternalClass71332291DD66449DAAE26E4F77FDC8E0"&gt;   &lt;p&gt;A while back on the Twitter, I posted a question that started a few ripples. Has SharePoint Saturday jumped the shark? (Millions of parrotheads will tell you that fins to the left are never a bad thing!)&lt;/p&gt;    &lt;p&gt;I did not originate the question, but I do admit to giving it a very public position. But I think the time is right for such a discussion. The SharePoint world is growing, there will be another &amp;quot;official&amp;quot; SharePoint conference from Microsoft for the second year in a row, and the SPS movement has matured.&lt;/p&gt;    &lt;p&gt;On the &amp;quot;Yes&amp;quot; side of the answer are two complaints I’ve heard often:&lt;/p&gt;     &lt;ul&gt;       &lt;li&gt;It is a clique and it is the same speakers over and over. Those speakers just want to visit places for free. &lt;/li&gt;        &lt;li&gt;It is all about vendors &lt;/li&gt;     &lt;/ul&gt;    &lt;p&gt;I would like to respond with a few questions of my own:&lt;/p&gt;     &lt;ul&gt;       &lt;li&gt;Do you want to speak? Have you done so before? If a dozen people give up their weekend to come listen to you, will they feel it worthwhile? &lt;/li&gt;        &lt;li&gt;Did you know that local user groups are desperate for speakers, and are great for learning how to prepare and give a presentation? &lt;/li&gt;        &lt;li&gt;Can you afford the travel costs to SPS events? Did you know that you can register in the &lt;a href="http://www.ineta.org/"&gt;INETA&lt;/a&gt; Regional Speaker program and get reimbursed for travel to user groups? &lt;/li&gt;        &lt;li&gt;Do you work at a company that can provide meeting rooms for free? Do you work at a company that can feed 100 people for free? Do you work at a company that does not need customers and profits? &lt;/li&gt;        &lt;li&gt;Do you want to only take from the community and not give back? &lt;/li&gt;     &lt;/ul&gt;    &lt;p&gt;For the record, I think SharePoint Saturday is a great idea. I believe the regional nature of the events should be highlighted, and speakers be from those regions. I spoke at many of the early SPS events, but now only speak occasionally. That does not mean SPS is bad, it is just not conducive to *my* thoughts about community and *my* schedule.&lt;/p&gt;    &lt;p&gt;No, SPS has not jumped the shark.&lt;/p&gt;    &lt;p&gt;And since I mentioned schedules, my &lt;a href="/blog/Lists/Speaking%20Engagements/myevents.aspx"&gt;speaking schedule&lt;/a&gt; is now posted on this site. (That’s right, I am a capitalist just like every other vendor in the SharePoint ecosystem.)&lt;/p&gt; &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Category:&lt;/b&gt; &lt;a onclick="OpenPopUpPage('http://www.schaeflein.net/blog/_layouts/listform.aspx?PageType=4&amp;ListId={98F99240-B34A-4D5D-818C-B9F8E0C683F8}&amp;ID=3&amp;RootFolder=*', RefreshPage); return false;" href="http://www.schaeflein.net/blog/_layouts/listform.aspx?PageType=4&amp;ListId={98F99240-B34A-4D5D-818C-B9F8E0C683F8}&amp;ID=3&amp;RootFolder=*"&gt;Speaking&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Published:&lt;/b&gt; 1/11/2012 3:15 PM&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=KqOu4OnYcOs:X-lqSQJkh3o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=KqOu4OnYcOs:X-lqSQJkh3o:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=KqOu4OnYcOs:X-lqSQJkh3o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?i=KqOu4OnYcOs:X-lqSQJkh3o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PaulSchaeflein?a=KqOu4OnYcOs:X-lqSQJkh3o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PaulSchaeflein?i=KqOu4OnYcOs:X-lqSQJkh3o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSchaeflein/~4/KqOu4OnYcOs" height="1" width="1"/&gt;</description>
      <author>Paul</author>
      <category>Speaking</category>
      <pubDate>Wed, 11 Jan 2012 21:15:26 GMT</pubDate>
      <guid isPermaLink="false">http://www.schaeflein.net/blog/Lists/Posts/ViewPost.aspx?ID=11</guid>
    <feedburner:origLink>http://www.schaeflein.net/blog/Lists/Posts/ViewPost.aspx?ID=11</feedburner:origLink></item>
  </channel>
</rss>

