<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.rightpoint.com/community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Viewpoint : SharePoint 2007</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx</link><description>Tags: SharePoint 2007</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>The Truth About How Daily SharePoint Alerts Actually Work</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/08/26/the-truth-about-how-daily-sharepoint-alerts-actually-work.aspx</link><pubDate>Thu, 26 Aug 2010 16:26:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2817</guid><dc:creator>Chris Domino</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2817</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/08/26/the-truth-about-how-daily-sharepoint-alerts-actually-work.aspx#comments</comments><description>&lt;p class="Text"&gt;A document changes. &lt;/p&gt;
&lt;p class="Text"&gt;An Email gets sent. &lt;/p&gt;
&lt;p class="Text"&gt;What could be easier? &lt;/p&gt;
&lt;p class="Text"&gt;Well, off the top of my head: open-heart surgery, underwater basket-weaving, and giraffe tooth-brushing to name a few things. SharePoint alerting architecture is a powerful communications tool that provides a convenient mechanism for users to consume information from around the site. &lt;/p&gt;
&lt;p class="Text"&gt;That is, if you don&amp;#39;t mess with them. &lt;/p&gt;
&lt;p class="Text"&gt;But of course, we are going to mess with them. We want to control the time, frequency, and appearance of the Emails. The default out-of-the-box settings work, but not quite well enough. All that my client wanted to do was simplify (&lt;span class="Italic"&gt;not&lt;/span&gt; go nuts, but &lt;span class="Italic"&gt;simplify &lt;/span&gt;) the standard digest (daily) Email template, and have the notifications shoot out at 9:00 AM. I estimated about a day to do this. &lt;/p&gt;
&lt;p class="Text"&gt;All we had to do was comment out some CAML from the alerttemplates.xml file (located in 12\TEMPLATE\XML) and run an STSADM command, right? Remove the links and columns that they didn&amp;#39;t want in the template, and set the time when alerts go out. RIGHT? &lt;/p&gt;
&lt;p class="Text"&gt;WRONG! &lt;/p&gt;
&lt;p class="Text"&gt;To make a story that is longer than it is interesting shorter and more interesting, we went from OOTB alerts to a custom template to a custom handler using &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.ialertnotifyhandler.aspx" class="Link"&gt;IAlertNotifyHandler&lt;/a&gt; to alerts not working for a month to users getting Email bombs of duplicate alerts. We went through three different solutions, two different Microsoft support representatives, and one scary spelunk into the SharePoint database. However, we came out safe and sound on the other side, with a cathartic clarity around how SharePoint daily alerts &lt;span class="Italic"&gt;actually&lt;/span&gt; work. It wasn&amp;#39;t a perfect outcome; there was quite a bit of drama, but a happy client is a happy client. &lt;/p&gt;
&lt;p class="Text"&gt;What I&amp;#39;m not going to do is take you through all the steps required to either customize an alert template, or wire up a code handler to build the Email from scratch (which is what I opted for, since alerttemplate.xml is 10,211 lines long and besides I really like writing code). Someone already did a good enough job of that &lt;a target="_blank" href="http://blogs.msdn.com/b/sharepointdeveloperdocs/archive/2007/12/07/customizing-alert-notifications-and-alert-templates-in-windows-sharepoint-services-3-0.aspx" class="Link"&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;p class="Text"&gt;Instead, I want to provide a high level description of how SharePoint 2007 alerting infrastructure is put together. As I dug though the dumpsters of the Internet looking for any clues to this end, I heard a lot of rumors and false positives and frightening tales. I also came across a new golden nuggets, either from dependable sources, my own research, or the words from Microsoft&amp;#39;s mouth itself. So what I&amp;#39;m going to do is simply list out the pieces that work together to make alerts work, having already scrubbed out all the wrong turns I made while traversing down this path. &lt;/p&gt;
&lt;p class="Text"&gt;So here are the truths about daily alerts, in Q &amp;amp; A form... &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;Which timer job executes daily alerts?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;The &amp;quot;Immediate Alerts&amp;quot; job.&lt;br /&gt;&lt;br /&gt;&lt;span class="Underline"&gt;Wait isn&amp;#39;t that job that runs the immediate alerts?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;Yes. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;So the one job handles all alert notifications? &lt;/span&gt;&lt;/p&gt;
&lt;p class="Text"&gt;Yes. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;There is no &amp;quot;Daily Alerts&amp;quot; job? &lt;/span&gt;&lt;/p&gt;
&lt;p class="Text"&gt;No. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;Promise? &lt;/span&gt;&lt;/p&gt;
&lt;p class="Text"&gt;Promise. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;Which server physically executes this job?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;Officially: All timer jobs run on all front end servers. So any web front end (or indexer, as I&amp;#39;ve seen) that has the proper assets deployed to it for a particular timer job (DLLs, XML files, etc.) can execute it successfully. Unofficially: not really; even though Central Administration -&amp;gt; Operations -&amp;gt; Timer Job Status &lt;span class="Italic"&gt;reports&lt;/span&gt; that the Immediate Alerts job runs on all servers, only one is actually doing the work. &lt;/p&gt;
&lt;p class="Text"&gt;To determine which one, you have to dive into the database. I know. It&amp;#39;s ugly; it hurts. Shush. Run the following query against the content database for your web application: &lt;/p&gt;
&lt;p class="Text"&gt;
&lt;table cellpadding="0" cellspacing="0" class="CodeLayout"&gt;
&lt;tbody&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellTopLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellMiddleLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellMiddleLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleMiddle"&gt;
&lt;div class="CodeContainer"&gt;
&lt;div class="CodeLayout"&gt;&lt;ol class="Code"&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;SELECT &lt;/span&gt;&lt;span class="Operator"&gt;*&lt;/span&gt;&lt;span class="Keyword"&gt; FROM &lt;/span&gt;TimerLock&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td class="CodeCellMiddleSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellBottomLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p class="Text"&gt;What this does is return the one and only row there will ever be from this table. The two columns are a name of a server, and a date. All we really care about is the name of the server: this is the one that&amp;#39;s going to do the notification work. If you want to change it to another server, stop the &amp;quot;Windows SharePoint Services Timer&amp;quot; service on this box, and wait for another server to jump in and acquire this lock. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;When do daily alerts get sent?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;OOTB, alerts are enabled, and the Immediate Alerts job runs every five minutes. What these runs do is ask the question: Are there any alerts that want to be sent out, but haven&amp;#39;t been? All alerts that answer &amp;quot;Yes!&amp;quot; get sent out. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;So how do daily alerts know that they want to be sent?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;Every alert has a time. For daily alerts, this time defaults to one day (or, more accurately, 24 hours) from the instant they are created. If you create an alert OOTB, you can select an hour on the UI, and the alert will be sent 24 hours from that time. In either case, this &amp;quot;Alert Time&amp;quot; is stored as a real, absolute time, not a &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.timespan.aspx" class="Link"&gt;TimeSpan&lt;/a&gt;. &lt;/p&gt;
&lt;p class="Text"&gt;So every time the Immediate Alerts job runs, it checks for alerts whose time is less than the current time. For each one, it fires the Email, and increments this time by another 24 hours. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;What about the job-immediate-alerts property?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;All this does is regulates how often the Immediate Alerts job runs. This has no effect if alerts are disabled (the &amp;quot;alerts-enabled&amp;quot; property is set to false). Remember, these properties are specific to a web application. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;And what about the job-daily-alerts property?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;The main purpose of this property is to confuse the hell out of everyone. This command has been deprecated since SharePoint 2003, but was never removed from the command line. &lt;/p&gt;
&lt;p class="Text"&gt;It has &lt;span class="Bold"&gt;NO&lt;/span&gt; effect. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;On anything?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Bold"&gt;NOTHING.&lt;/span&gt; Don&amp;#39;t ever think about it. Ever. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;So in summary?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;In summary, alerts store the &lt;span class="Italic"&gt;next&lt;/span&gt; time they want to be sent. Every execution of the Immediate Alerts timer job on the server that has acquired the &amp;quot;TimerLock&amp;quot; (for that content database) will send any daily alerts whose time is in the past. Finally, it will increment these times by 24 hours. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Underline"&gt;Anything else?&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;Now, there&amp;#39;s one other phenomena that I&amp;#39;ve observed with all this alert stuff: duplicates. And just duplications, but DUPLICATES - as many as a half dozen extra Emails per each unique notification. The most bizarre case we saw was when a user had an alert against a document library that saw five changes in one day, and he received five Emails: one with all five changes listed, one with only the first four, and so on, down to one Email advertising just one change. &lt;/p&gt;
&lt;p class="Text"&gt;What was causing the duplication? The prime suspect was of course the customization of the template, which, admittedly, had a bug, and was broken for some time: there were no alerts for weeks. But eventually I fixed it, and proved it by writing to the ULS logs each time the handler was invoked. And indeed, it was called exactly once for each Email the aforementioned user received. So why was one alert sending out so many notifications? &lt;/p&gt;
&lt;p class="Text"&gt;The most bizarre aspect of this problem was how it was solved, because it solved itself. It was as though the SharePoint alerting infrastructure had a cold: it got worse and worse, barfed, and then started to get better and better. Seriously. My user reported that he got fewer and fewer duplicates each day, until it completely worked itself out and only sent out one notification per alert; each Email containing a list of changes that that document library had experienced over those last 24 hours. &lt;/p&gt;
&lt;p class="Text"&gt;Of course this is unsettling; problems that solve themselves usually have the propensity to start themselves back up. I had a hunch, and I don&amp;#39;t blog about hunches. However, I will blog about hunches that Microsoft Premier Support endorses! &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Rant"&gt;&amp;lt;HUNCH&amp;gt;&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;First, a bit of background: there is another database table that people seem to get their hands dirty with when it comes to fixing alerts: EventCache. What from I can tell, this is the backlog of all changes made to all document libraries. We can then think of alerts as sort of queries into this table. Once an alert gobbles up a change, that change is marked as processed and won&amp;#39;t be alerted against again. &lt;/p&gt;
&lt;p class="Text"&gt;Therefore, a daily alert notification is actually the intersection of all unique changes that an alert (which is welded to a document library) &amp;quot;finds.&amp;quot; What happens if those changes in EventCache are never processed? They are dangling there, like icicles, waiting to melt back down to the ground. If alerts are broken, these changes seem to just stack up. &lt;/p&gt;
&lt;p class="Text"&gt;Eventually, when alerts are fixed, that stack will topple. It will be like unclogging a drain. However, that&amp;#39;s not what happened. The Email duplications diminished slowly, as if each alert could only pull changes from &lt;span class="Italic"&gt;one&lt;/span&gt; day at a time. In other words, the alert, when activated by the Immediate Alerts job, doesn&amp;#39;t seem to blindly ask EventCache for &amp;quot;all unprocessed changes for this document library&amp;quot; (as I would assume) but rather for &amp;quot;some 24 hour block of changes.&amp;quot; Maybe it&amp;#39;s that timeframe that gets out of whack, and changes from two different days are processed in the same batch. Or perhaps the logic is flawed, and times aren&amp;#39;t updated properly if the notification system is malfunctioning due to a bug somewhere in the template customization. &lt;/p&gt;
&lt;p class="Text"&gt;It still makes more sense to me that, once repaired, all notifications will be shot out in the next batch. Furthermore, I think it&amp;#39;s counterintuitive that &amp;quot;old&amp;quot; changes should be notified at all. If a user hooks up an alert, they want new information - new content. The apropos availability of old news isn&amp;#39;t new news. &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Rant"&gt;&amp;lt;/HUNCH&amp;gt;&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;Each day as the alerts were &amp;quot;worsening&amp;quot; and then &amp;quot;healing&amp;quot; themselves, my client user forward me all the Emails he got. So did another user, who only had one alert, and only got dups sometimes. The point is that there were no discernable patterns. I poured over the frequencies among alerts, number of Emails, and number of changes in each Email, but came up with nothing. I spent hours digging though verbose ULS logs, only to further validate that my custom handler was called exactly once per whatever it was that SharePoint was detecting as a notification. &lt;/p&gt;
&lt;p class="Text"&gt;When my Microsoft rep backed up the above hunch, I was encouraged, but not satisfied. Unfortunately, this remains a mystery to this day. Microsoft closed the case without any more discussion. My client closed the bug without any more discussion. It&amp;#39;s like everyone but is happy that this one little bug - which was only supposed to take a day to implement - has magically disappeared. &lt;/p&gt;
&lt;p class="Text"&gt;Well it&amp;#39;s time for me to join their ranks, as there is no more time, money, calories, or sanity to invest into the duplicate alert issue. Usually my posts have happy endings, but alerts are emo like that. If anyone out there has any ideas, please don&amp;#39;t hold back. Hopefully I was able to at least help a little bit in terms of cracking open the black box of enigmatic SharePoint 2007 daily alerts. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2817" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Alerts/default.aspx">Alerts</category></item><item><title>InfoPath Browser Enabled Forms and Crossing Web Applications</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/08/13/infopath-browser-enabled-forms-and-crossing-web-applications.aspx</link><pubDate>Fri, 13 Aug 2010 17:09:15 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2814</guid><dc:creator>Jeremy Williams</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2814</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/08/13/infopath-browser-enabled-forms-and-crossing-web-applications.aspx#comments</comments><description>&lt;h2&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: &lt;/h2&gt;  &lt;p&gt;A browser-enabled InfoPath form was to be built that allowed users to fill out a form, email it to themselves, attach a document to be uploaded to SharePoint, and then sent to an individual that understands SharePoint.&amp;#160; Sure, the easy answer here is to make the user upload the file directly and just classify it there.&amp;#160; The problem is that many users are unwilling to be trained on SharePoint, so this was elected as a compromise to fully utilizing SharePoint.&amp;#160; There’s some other border-cases that this form solves, but this is neither here nor there.&amp;#160; &lt;/p&gt;  &lt;h2&gt;&lt;strong&gt;Challenge&lt;/strong&gt;: &lt;/h2&gt;  &lt;p&gt;The form has a number of drop-downs in it, some are SharePoint ‘choice’ fields, and two are SharePoint ‘lookup’ fields.&amp;#160; The choice fields all function just fine since I’m using a nice little XML file to specify those dropdowns (they rarely change and it’s much quicker to load than querying all of the lists).&amp;#160; The lookup lists do need to be refreshed on each form load, since those are subject to additions.&amp;#160; However, InfoPath Browser forms have a nasty habit of ordering SharePoint-list-data source values by ID rather than Title.&amp;#160; [To add further insult to injury, the full-blown InfoPath client orders by Title..]&amp;#160; Users wouldn’t go for that on lists that contain upwards of 500 choices, so I had to find a way to order by Title…&lt;/p&gt;  &lt;p&gt;After reading some great articles on using owssvr.dll to get a XML output for a particular list, I figured I had the problem licked.&amp;#160; This method would allow me to return live data (on form-load), required no code-behind, and &lt;em&gt;seemed &lt;/em&gt;straight-forward.&amp;#160; So I followed the instructions (&lt;a title="http://blogs.msdn.com/b/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx" href="http://blogs.msdn.com/b/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx"&gt;http://blogs.msdn.com/b/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx&lt;/a&gt;), and then pressed enter to get a plain-white IE window (no XML as promised).&amp;#160; After verifying that this wasn’t some obscure browser setting, I looked at the lists I was referencing and they were (both) custom lists that also had lookup columns contained within.&amp;#160; I then suspected that the lookup column (especially one that allowed multi-select) wasn’t supported by the owssvr.dll method.&amp;#160; Luckily for me, we are running a nifty little master-list data synchronization on this environment.&amp;#160; The custom code basically reads a list (considered the ‘master’) on Web Application A, Site Collection A, and then writes any add/update/delete actions to copy-lists stored other Site Collections under Web Application B.&amp;#160; Anyways, the ‘synchronized’ lists don’t contain the lookup columns, just the ‘ID’ and ‘Title’ values.&amp;#160; Effectively, this allowed me to test owssvr.dll reading a ‘simple’ list…&lt;/p&gt;  &lt;p&gt;After running a quick test, I discovered that owssvr.dll worked famously with the sync-lists!&amp;#160; So, I rebuilt my form data connections, redeployed the form, and then BAM! Yet another error about SharePoint not being able to access data sources [Error ID 6932](and all of my dropdowns of lookup lists were blank).&amp;#160; After some poking around, I surmised that InfoPath form services (even with cross-domain enabled) doesn’t like crossing SharePoint web applications, even though the user account I was using had permissions to both web applications.&lt;/p&gt;  &lt;h2&gt;&lt;strong&gt;&lt;strong&gt;&lt;strike&gt;Fix&lt;/strike&gt;…Workaround&lt;/strong&gt;: &lt;/strong&gt;&lt;/h2&gt;  &lt;p&gt;So, to get the form to play nice, I simply deployed my form and associated data sources in a site under Web Application B.&amp;#160; By doing this, my owssvr.dll XML files could reference the appropriate sync-lists correctly and in the same web application.&amp;#160; After I did this, the form worked as advertised and I simply changed all of the applicable links to point to the new form location.&lt;/p&gt;  &lt;p&gt;I realize that this is a fairly unique scenario, but I think there are a couple of important takeaways.&amp;#160; First of all, for users that are running into the blank-white IE screen when using owssvr.dll, hopefully this post helps you in your test cases by trying the method after removing lookup columns.&amp;#160; And Second, for those who might be considering/trying to get InfoPath Browser Forms to cross web applications, realize that you may have to somehow provide a simplified version of your list-data.&amp;#160; &lt;/p&gt;  &lt;p&gt;At the end of the day, the form worked as advertised, and the correct columns were returned (and ordered).&amp;#160; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2814" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Office+2010/default.aspx">Office 2010</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Tag/default.aspx">Tag</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/InfoPath/default.aspx">InfoPath</category></item><item><title>Customizing People Search Results in MOSS 2007 – Part 3 of 3 – Search Results Customization</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/06/14/customizing-people-search-results-in-moss-2007-part-3-of-3-search-results-customization.aspx</link><pubDate>Mon, 14 Jun 2010 17:51:28 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2802</guid><dc:creator>Jeremy Williams</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2802</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/06/14/customizing-people-search-results-in-moss-2007-part-3-of-3-search-results-customization.aspx#comments</comments><description>&lt;p&gt;This is the third and final post of a three part series, if you missed it, here’s &lt;a href="http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/05/25/customizing-people-search-results-in-moss-2007-part-1-of-3-user-profile-properties-change.aspx" target="_blank"&gt;Part 1&lt;/a&gt; and &lt;a href="http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/06/09/customizing-people-search-results-in-moss-2007-part-2-of-3-search-configuration.aspx" target="_blank"&gt;Part 2&lt;/a&gt;.&amp;#160; This post will go into the details of consuming the managed properties we configured last time around, and then displaying them in our search results.&lt;/p&gt;  &lt;p&gt;As a review, here’s where we are:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/05/25/customizing-people-search-results-in-moss-2007-part-1-of-3-user-profile-properties-change.aspx" target="_blank"&gt;User Profile Properties Changes&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/06/09/customizing-people-search-results-in-moss-2007-part-2-of-3-search-configuration.aspx" target="_blank"&gt;SharePoint Search Changes&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Search Results Page Customization&lt;/strong&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb.png" width="408" height="398" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Add Managed Properties to List of Columns to Query&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The first step to displaying your newly added managed properties in the search results is make sure they’re being returned as part of your result-set!&amp;#160; To do this, navigate to the people search result page on your Search site.&amp;#160; A quick and easy way to do this is to run a search (using the ‘People’ scope) for your own name.&amp;#160; Once you’re on the search page, go ahead and edit the page.&amp;#160; Once you have the page in edit mode, click on the context menu for ‘People Search Core Results’ and select ‘Modify Shared Web Part’.&amp;#160; On the pane that appears to the right, go ahead and expand the ‘Results Query Options’ Group, then click the text box under the ‘Selected Columns’ heading; and finally, click on the button with the ellipsis (…).&amp;#160; This will pop up a text editor.&amp;#160; To prevent yourself from going a little crazy, I highly recommend editing this text in something else, like Notepad/Wordpad/your favorite IDE/etc.&amp;#160; You will want to add a line (below) for each of your newly added custom managed properties.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;Column Name=&amp;quot;YourManagedPropertyNameHere”/&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In the screenshot below, you can see that I’m adding my ‘StreetAddress’ managed property: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_6.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_2.png" width="304" height="232" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once you’ve added all of your properties, go ahead and paste your XML&amp;#160; back into SharePoint pop-up text box and click ‘Ok’ on the web part property pane to save your changes.&amp;#160; Now, your custom property is available to and for our final step…&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Reference columns in custom XSLT&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now that the people search core results web part is properly returning your managed columns, you’ll want to customize it’s XSLT (style sheet) to include the newly added column(s).&amp;#160; Same as last time, I highly recommend you edit this XSLT in your favorite IDE, as it’s really painful to work with code in SharePoint’s popup text-editor.&amp;#160; Anyways, to access the XSLT, go ahead and click ‘Modify Shared Web Part’ on the People Search Core results web part, and click the ‘XSL Editor…’ button.&amp;#160; &lt;/p&gt;  &lt;p&gt;The XSLT sheet that ships with SharePoint is about 360 lines long, and there’s a couple of places you’ll need to add your column(s).&amp;#160; For the example, I’m simply going to stick in the ‘StreetAddress’ field after a user’s title, department, phone, and office.&amp;#160; Certainly, you can do much cooler things here with the XSLT, but I’ll save that for another day.&amp;#160; The first place you’ll need to add your column is around line 137.&amp;#160; In my example below, I have established my XSLT variable for StreetAddress as ‘street’ (mainly to illustrate the naming differences).&lt;/p&gt;  &lt;p&gt;Important Note: in the ‘select’ value, be sure to use ONLY lowercase text; if you do capitalize names here, you run a very high risk of the proper field not being returned.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_22.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_10.png" width="354" height="103" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The next place to add the property is around line 337, as shown below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_10.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_4.png" width="304" height="100" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And finally, I’ve added an XSL if-block with street around line 355:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_12.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_5.png" width="304" height="278" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Doing this will yield the following results:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_4.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_1.png" width="408" height="135" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_18.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_8.png" width="408" height="135" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Clearly, the trickiest part of this process is the XSLT customization, which is why I’ve chosen to show you how to simply add a property to the XSLT.&amp;#160; You can do all kinds of cool things with XSLT, such as return the users in a grid pattern with key information beneath their picture, or return people with a contact-card styling, the list is as long as your imagination.&amp;#160; &lt;/p&gt;  &lt;p&gt;Thanks for sticking through all three posts with me; I hope this helps clear up any confusion on the whole process.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Errata&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Random Error&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Sometimes, SharePoint will throw a false error at you after clicking ‘Ok’ to web part changes.&amp;#160; The error looks something like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_14.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_6.png" width="454" height="62" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you do come across this, simply check in your page and then click in the URL bar and press enter (don’t just refresh the page).&amp;#160; If you still get the error after that, you’ve most likely made a coding error in your XSLT.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Field Not Displaying&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;If your field isn’t returning, and you’re fairly confident that you’ve written valid XSLT and added/configured/mapped all your properties correctly, you might need to refresh your user profiles.&amp;#160; To do this, initiate a full import on your people profiles in SharePoint.&amp;#160; Once the full import has completed, start an incremental search crawl to pick up these changes.&amp;#160; Once complete, go ahead and run your people search again and your field should now appear:&lt;/p&gt;  &lt;p&gt;Example of Missing Field (notice the hanging ‘-&amp;#39; after ‘Downtown’; this is where Street Address should be:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_16.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_7.png" width="354" height="92" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Example of the Missing Field existing as expected:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_20.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_9.png" width="354" height="99" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2802" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/search/default.aspx">search</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Customizing People Search Results in MOSS 2007 – Part 2 of 3 – Search Configuration</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/06/09/customizing-people-search-results-in-moss-2007-part-2-of-3-search-configuration.aspx</link><pubDate>Wed, 09 Jun 2010 17:36:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2800</guid><dc:creator>Jeremy Williams</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2800</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/06/09/customizing-people-search-results-in-moss-2007-part-2-of-3-search-configuration.aspx#comments</comments><description>&lt;p&gt;This is the second post of a three part series, if you missed it, here&amp;rsquo;s &lt;a target="_blank" href="http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/05/25/customizing-people-search-results-in-moss-2007-part-1-of-3-user-profile-properties-change.aspx"&gt;Part 1&lt;/a&gt;.&amp;nbsp; This post will go into the details of taking the User Profile Properties we created the last time around, and making sure that they&amp;rsquo;re available to us in Search.&lt;/p&gt;
&lt;p&gt;As a review, here&amp;rsquo;s where we are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/05/25/customizing-people-search-results-in-moss-2007-part-1-of-3-user-profile-properties-change.aspx"&gt;User Profile Properties Changes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SharePoint Search Changes&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.rightpointconsulting.com/community/blogs/viewpoint/archive/2010/06/14/customizing-people-search-results-in-moss-2007-part-3-of-3-search-results-customization.aspx"&gt;Search Results Page Customization &lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_2.png"&gt;&lt;img height="400" width="408" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Run an incremental crawl&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you haven&amp;rsquo;t already, be sure to run a full import on your user profiles (This should be done after you&amp;rsquo;ve added all your custom profile properties from step one)&amp;nbsp; Assuming that a full import has run, the next step is to run a crawl on whatever content source is crawling people.&amp;nbsp; 9 times out of 10, this would be the &amp;lsquo;Local Office SharePoint Server Sites&amp;rsquo; content source.&amp;nbsp; This can be done by going to your Search Administration page, clicking on &amp;lsquo;Content Sources&amp;rsquo; then selecting &amp;lsquo;Start Incremental Crawl&amp;rsquo; from the &amp;lsquo;Local Office SharePoint Server Sites&amp;rsquo; context menu.&lt;/p&gt;
&lt;p&gt;After the crawl has completed, it should have picked up all of your newly defined user profile properties as a crawled property.&amp;nbsp; Next, we&amp;rsquo;ll want to use those newly crawled properties in the creation of our managed properties.&amp;nbsp; The managed property will (ultimately) be used to return information about a user in the search results.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Add mapped profile properties as managed properties&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To create a new Managed Property, navigate to your SSP management page.&amp;nbsp; From there, click on Search Administration, and then click on &amp;lsquo;Metadata properties&amp;rsquo;.&amp;nbsp; Once at the &lt;em&gt;Metadata Property Mappings &lt;/em&gt;window, click on the &amp;lsquo;New Managed Property&amp;rsquo; link, which will take you to a screen similar to the one shown below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_4.png"&gt;&lt;img height="257" width="454" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_1.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This is where you will be defining the name (to be used in search) of all your people profiles.&amp;nbsp; Personally, I like to use the same name as that returned by the crawled property.&amp;nbsp; This is due to the fact that I handled the naming of the property when I created it.&amp;nbsp; It simply makes life easier to remember only one property name that to track the property through all phases (AD, Profile Property, Crawled Property, Managed Property, XSLT variable).&amp;nbsp; In the screenshot above, I have created a managed property for Street Address.&amp;nbsp; Assuming you&amp;rsquo;re following my advice above, you will use the same profile property name for naming the managed property.&amp;nbsp; In my example, this yields a Property name of: &amp;ldquo;StreetAddress&amp;rdquo;.&amp;nbsp; Filling in a description is strictly optional, I have elected not to do so in my example.&amp;nbsp; Be sure to leave the &amp;lsquo;Text&amp;rsquo; radio button checked, as this will act as a filter on crawled property search we&amp;rsquo;re about to run.&amp;nbsp; [Obviously, if you&amp;rsquo;re adding a crawled property that is an integer value, be sure to change this radio to reflect as such] Next, you will need to click &amp;lsquo;Add Mapping&amp;rsquo; to select the crawled property(-ies) referenced by this managed property.&amp;nbsp; In my example, I know that I named by Profile Property &amp;lsquo;StreetAddress&amp;rsquo;, so I&amp;rsquo;ll search for &amp;lsquo;Street&amp;rsquo; in the dialog:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_6.png"&gt;&lt;img height="339" width="304" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_2.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This is an easy one, as only 1 result was returned.&amp;nbsp; Generally speaking, if you get more than 1 result, be sure to select the result prefixed with &amp;lsquo;People&amp;rsquo;.&amp;nbsp; Click Ok and you&amp;rsquo;ll return to the &amp;lsquo;New Managed Property&amp;rsquo; Screen.&amp;nbsp; The remaining options shouldn&amp;rsquo;t impact us, so you can leave them alone.&amp;nbsp; Go ahead and click Ok.&amp;nbsp; Voila, you&amp;rsquo;ve created a Managed Property for StreetAddress, bringing you one step closer to your customized People Search experience.&amp;nbsp; Repeat as necessary for all of the properties you&amp;rsquo;ve added to User Profiles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Run an incremental crawl&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you&amp;rsquo;re finished adding all of your new Managed Properties, you&amp;rsquo;ll need to run an incremental crawl.&amp;nbsp; Disclaimer: Most (if not all) Microsoft documentation claims that you have to run a full crawl at this point.&amp;nbsp; I&amp;rsquo;ve only had to do that once for &lt;em&gt;people profiles&lt;/em&gt; and their associated metadata properties; typically, the incremental crawl works for me.&amp;nbsp; The purpose of this crawl is to &amp;lsquo;pick up&amp;rsquo; all of your newly update managed properties.&amp;nbsp; Once you start this crawl, go ahead and get yourself a cup of coffee and marvel at your SharePoint prowess!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That wraps it up for the second step of the process.&amp;nbsp; I hope to have the third and final post up soon, so stay tuned!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2800" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/search/default.aspx">search</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Customizing People Search Results in MOSS 2007 – Part 1 of 3 – User Profile Properties Change</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/05/25/customizing-people-search-results-in-moss-2007-part-1-of-3-user-profile-properties-change.aspx</link><pubDate>Tue, 25 May 2010 14:03:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2798</guid><dc:creator>Jeremy Williams</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2798</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/05/25/customizing-people-search-results-in-moss-2007-part-1-of-3-user-profile-properties-change.aspx#comments</comments><description>&lt;p&gt;One of the niceties (at least for us implementer-folk) of SharePoint&amp;rsquo;s search is that both the content and display of the result page can be changed with a few tweaks to some the profile sync process, managed properties, search query result web part properties, and the result XSLT.&amp;nbsp; Okay, so I&amp;rsquo;ll admit, it isn&amp;rsquo;t the most straightforward process, but it&amp;rsquo;s still pretty cool that this can all be accomplished without any custom code!&amp;nbsp; If you have liberal definitions of &amp;ldquo;out of the box SharePoint functionality&amp;rdquo; like I do, then you&amp;rsquo;re in luck.&amp;nbsp; Everything we&amp;rsquo;ll be going through here can be considered Out of Box!&lt;/p&gt;
&lt;p&gt;Alright, so this post-series will be fairly detailed, therefore it will be broken up (for both author and reader sanity) into three parts:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;User Profile Properties Changes&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.rightpointconsulting.com/community/blogs/viewpoint/archive/2010/06/09/customizing-people-search-results-in-moss-2007-part-2-of-3-search-configuration.aspx"&gt;SharePoint Search Changes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.rightpointconsulting.com/community/blogs/viewpoint/archive/2010/06/14/customizing-people-search-results-in-moss-2007-part-3-of-3-search-results-customization.aspx"&gt;Search Results Page Customization&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For those of you that have done any searching on the subject, you will find a decent amount of custom people search XSLT result sets out there.&amp;nbsp; However, what you&amp;rsquo;ll struggle to find is an end-to-end instruction set to fully implement a customized people search experience.&amp;nbsp; I know it&amp;rsquo;s a lofty goal, but I hope this series of posts can help you get from zero to your custom people search experience.&amp;nbsp; At the very least, it should get you pretty close!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;So here&amp;rsquo;s the process that we&amp;rsquo;ll be going through:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_6.png"&gt;&lt;img height="394" width="404" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_2.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are only going to use the 21 or so default mapped properties, feel free to skip ahead to the second post.&amp;nbsp; Again, this first part is &lt;strong&gt;only&lt;/strong&gt; required if you have non-standard user properties that you would like to display in People Results.&amp;nbsp; My favorite example of a non-standard attribute is the &amp;lsquo;Mobile Phone&amp;rsquo; value.&amp;nbsp; In most AD implementations, a standard user account will not be able to &amp;lsquo;read&amp;rsquo; this attribute into SharePoint&amp;rsquo;s user profiles.&amp;nbsp; In order to properly access these properties, work with your AD administrator to secure a Profile Import Account with the correct level of access.&amp;nbsp; Basically, the account will need the ability to read each of the fields that you&amp;rsquo;re working to import.&amp;nbsp; I&amp;rsquo;m not going to dive into the details of setting up the correct permissions in this series, perhaps in the future I&amp;rsquo;ll tackle that subject.&amp;nbsp; In the meantime, if (and only if) you&amp;rsquo;re in a test environment, the easy solution is to use a Domain Administrator account; please &lt;strong&gt;do not&lt;/strong&gt; do this in your production environment.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;To change this account, navigate to the Shared Services Provider (SSP) that you&amp;rsquo;ll be working on (you may have a direct link and/or it&amp;rsquo;s accessible from Central Administration).&amp;nbsp; Once on the SSP homepage, click the &amp;lsquo;User Profiles and Properties&amp;rsquo; link.&amp;nbsp; From the next page, you will want to click on the &amp;lsquo;Configure Profile Import&amp;rsquo; link.&amp;nbsp; From the following page, select the &amp;lsquo;Specify Account&amp;rsquo; radio button in the &amp;lsquo;Default Access Account&amp;rsquo; heading and enter in the credentials for your elevated account.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step in the process is to add whatever additional fields you need to the &amp;lsquo;User Profiles and&amp;nbsp; Properties&amp;rsquo; area.&amp;nbsp; To do this, navigate to SSP homepage, and click on the &amp;lsquo;User Profile Properties&amp;rsquo; link.&amp;nbsp; Near the bottom of this window, you will see a heading called &amp;lsquo;User Profile Properties&amp;rsquo;; click on the &amp;lsquo;Add profile property&amp;rsquo; link.&amp;nbsp; This will bring you to the form shown below.&amp;nbsp; If you&amp;rsquo;re looking to display the &amp;lsquo;mobile&amp;rsquo; attribute (or whatever value you&amp;rsquo;re adding here) to all employees, feel free to mirror the settings in the screenshot below.&amp;nbsp; If not, tweak the settings to your liking. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_8.png"&gt;&lt;img height="960" width="454" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_3.png" alt="image" border="0" title="image" style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The hardest part of this form is the dropdown near the end where you actually select what Active Directory field you will be mapping to.&amp;nbsp; These field names are not necessarily intuitively named.&amp;nbsp; For example, city is called &amp;lsquo;l&amp;rsquo;.&amp;nbsp; To get an idea of what field you&amp;rsquo;re looking for, go ahead and and fire up ADSI Edit and connect to your favorite domain controller.&amp;nbsp; From here, you&amp;rsquo;ll want to navigate to an OU that contains a User Account with the property that you&amp;rsquo;re looking for.&amp;nbsp; Once you find the user account, go ahead and right click on it, and select properties.&amp;nbsp; This will bring you an exhaustive list of that object&amp;rsquo;s AD attributes.&amp;nbsp; Go ahead and find the property you&amp;rsquo;re looking for and then select that property in SharePoint&amp;rsquo;s Add User Profile Form.&amp;nbsp; Be sure to note the AD-names of all properties that you add as you&amp;rsquo;ll need this list later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After clicking OK and repeating this process for all of the non-standard fields you want to import you should be ready to move on to the next post, which I&amp;rsquo;ll finish up in the next couple of days.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2798" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/search/default.aspx">search</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Building a Better SPGridView</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/03/30/building-a-better-spgridview.aspx</link><pubDate>Tue, 30 Mar 2010 17:15:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2782</guid><dc:creator>jrupp</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2782</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/03/30/building-a-better-spgridview.aspx#comments</comments><description>&lt;p&gt;Sometimes with SharePoint customizations, you run into a scenario where you want to do something that is &amp;ldquo;just like this OOTB thing, but a little bit different.&amp;rdquo; Sometimes, that turns out to be trivial. Sometimes it turns out to be a fair amount of work to get what you want. &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spgridview.aspx"&gt;SPGridView&lt;/a&gt; is one the latter &amp;ndash; sounds great, but takes more work than I&amp;rsquo;d like to be at feature-parity with the less generic components.&lt;/p&gt;
&lt;p&gt;Recently, I had two different projects that wanted something that looked like a ListViewWebpart, but had a more complex data source than a simple view on a list (both involved fetching data from multiple sites within the site collection and joining it to a couple of other lists). Seems simple enough, right? Fetch the data needed from all the source lists (and/or cross-site queries via &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx"&gt;SPSiteDataQuery&lt;/a&gt;) into custom objects, join them together via &lt;a href="http://msdn.microsoft.com/en-us/library/bb397919.aspx"&gt;LINQ-to-Objects&lt;/a&gt;, stick the results in a DataTable, display it with SPGridView, and off to the next task, right? Well, yes. It does look right, but sorting and filtering don&amp;rsquo;t work. Even when you add ObjectDataSource to the mix, there are issues with sorting and filtering getting in each other&amp;rsquo;s way.&lt;/p&gt;
&lt;p&gt;After a bit more digging online, I found a few sources that pointed me in the right direction of what I&amp;rsquo;d need to do to make it all work:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.reversealchemy.net/2009/05/01/building-a-spgridview-control-part-1-introducing-the-spgridview/"&gt;http://www.reversealchemy.net/2009/05/01/building-a-spgridview-control-part-1-introducing-the-spgridview/&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.reversealchemy.net/2009/05/24/building-a-spgridview-control-part-2-filtering/%20"&gt;http://www.reversealchemy.net/2009/05/24/building-a-spgridview-control-part-2-filtering/&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://vspug.com/bobsbonanza/2007/07/02/filtering-with-spgridview/%20"&gt;http://vspug.com/bobsbonanza/2007/07/02/filtering-with-spgridview/&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With these, plus a bit of tinkering, I got it to work like my first client wanted. However, I had to do a lot more work than I wanted to make it happen &amp;ndash; until the last piece was in place, it wouldn&amp;rsquo;t work quite right. Two weeks later, I had another client ask me for almost the same thing (obviously, the data involved was quite a bit different, but the basic idea was the same &amp;ndash; custom data fed into a table that looks like a normal SharePoint one). Since I&amp;rsquo;m a heavy opponent of &amp;ldquo;reuse by copy and paste&amp;rdquo;, I thought I&amp;rsquo;d separate out the &amp;ldquo;fixes&amp;rdquo; to the SPGridView from the particulars of this implementation and build a control I could use in the future when this kind of scenario came up.&lt;/p&gt;
&lt;p&gt;In my mind, the developer wanting to use this control should only have to provide the information relevant to the problem domain (data, columns) and leave the implementation details (wiring sorting/filtering to work and work together) up to the control. To that end, I present SmartSPGridView:&lt;/p&gt;
&lt;pre style="overflow:auto;"&gt;&lt;div style="font-family:Courier New;font-size:10pt;color:black;background:white;"&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;using&lt;/span&gt; Microsoft.SharePoint.WebControls;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Web.UI.WebControls;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Data;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Web.UI;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;namespace&lt;/span&gt; SPGridDemo&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/span&gt;&amp;nbsp;{&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; Wraps up everything needed for automatic sorting and filtering.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; Heavily based on:&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt;&amp;nbsp;&amp;nbsp; http://www.reversealchemy.net/2009/05/01/building-a-spgridview-control-part-1-introducing-the-spgridview/&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt;&amp;nbsp;&amp;nbsp; http://www.reversealchemy.net/2009/05/24/building-a-spgridview-control-part-2-filtering/&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; Triggering binding is left up to the parent control -- call GridView.DataBind() -- GetData event will be raised for you to supply the data.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; Also http://vspug.com/bobsbonanza/2007/07/02/filtering-with-spgridview/&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;SmartSPGridView&lt;/span&gt; : WebControl, INamingContainer&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre style="overflow:auto;"&gt;&lt;div style="font-family:Courier New;font-size:10pt;color:black;background:white;"&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; SmartSPGridView()&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// initialize the ObjectDataSource and SPGridView, wire them together and hook in the needed event handlers&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource = &lt;span style="color:blue;"&gt;new&lt;/span&gt; ObjectDataSource()&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SelectMethod = &lt;span style="color:#a31515;"&gt;&amp;quot;SelectData&amp;quot;&lt;/span&gt;,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TypeName = &lt;span style="color:blue;"&gt;this&lt;/span&gt;.GetType().AssemblyQualifiedName,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ID=&lt;span style="color:#a31515;"&gt;&amp;quot;DS&amp;quot;&lt;/span&gt;,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; GridView = &lt;span style="color:blue;"&gt;new&lt;/span&gt; SPGridView()&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AllowSorting = &lt;span style="color:blue;"&gt;true&lt;/span&gt;,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AllowFiltering = &lt;span style="color:blue;"&gt;true&lt;/span&gt;,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AutoGenerateColumns = &lt;span style="color:blue;"&gt;false&lt;/span&gt;,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FilteredDataSourcePropertyName = &lt;span style="color:#a31515;"&gt;&amp;quot;FilterExpression&amp;quot;&lt;/span&gt;,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FilteredDataSourcePropertyFormat = &lt;span style="color:#a31515;"&gt;&amp;quot;{1} = &amp;#39;{0}&amp;#39;&amp;quot;&lt;/span&gt;,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ID=&lt;span style="color:#a31515;"&gt;&amp;quot;view&amp;quot;&lt;/span&gt;,&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; GridView.DataSourceID = DataSource.ID;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource.ObjectCreating += &lt;span style="color:blue;"&gt;new&lt;/span&gt; ObjectDataSourceObjectEventHandler(DataSource_ObjectCreating);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource.Filtering += &lt;span style="color:blue;"&gt;new&lt;/span&gt; ObjectDataSourceFilteringEventHandler(DataSource_Filtering);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;42&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; GridView.Sorting += &lt;span style="color:blue;"&gt;new&lt;/span&gt; GridViewSortEventHandler(GridView_Sorting);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;43&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; GridView.RowDataBound += &lt;span style="color:blue;"&gt;new&lt;/span&gt; GridViewRowEventHandler(GridView_RowDataBound);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;44&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;45&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;46&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; SPGridView GridView { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;47&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; ObjectDataSource DataSource { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;48&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre style="overflow:auto;"&gt;&lt;div style="font-family:Courier New;font-size:10pt;color:black;background:white;"&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;49&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;50&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; Add filter header pieces&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;51&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;52&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;void&lt;/span&gt; GridView_RowDataBound(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, GridViewRowEventArgs e)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;53&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;54&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (sender == &lt;span style="color:blue;"&gt;null&lt;/span&gt; || e.Row.RowType != DataControlRowType.Header)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;55&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;56&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;57&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;58&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;59&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SPGridView grid = sender &lt;span style="color:blue;"&gt;as&lt;/span&gt; SPGridView;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;60&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;61&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;String&lt;/span&gt;.IsNullOrEmpty(grid.FilterFieldName))&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;62&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;63&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;64&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;65&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;66&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// Show icon on filtered column&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;67&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; grid.Columns.Count; i++)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;68&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;69&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DataControlField field = grid.Columns[i];&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;70&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;71&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (field.SortExpression == grid.FilterFieldName)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;72&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;73&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Image filterIcon = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Image();&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;74&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; filterIcon.ImageUrl = &lt;span style="color:#a31515;"&gt;&amp;quot;/_layouts/images/filter.gif&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;75&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; filterIcon.Style[HtmlTextWriterStyle.MarginLeft] = &lt;span style="color:#a31515;"&gt;&amp;quot;2px&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;76&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;77&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// If we simply add the image to the header cell it will&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;78&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// be placed in front of the title, which is not how it&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;79&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// looks in standard SharePoint. We fix this by the code&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;80&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// below.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;81&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Literal headerText = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Literal();&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;82&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; headerText.Text = field.HeaderText;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;83&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;84&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PlaceHolder panel = &lt;span style="color:blue;"&gt;new&lt;/span&gt; PlaceHolder();&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;85&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; panel.Controls.Add(headerText);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;86&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; panel.Controls.Add(filterIcon);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;87&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;88&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.Row.Cells[i].Controls[0].Controls.Add(panel);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;89&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;90&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;break&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;91&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;92&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;93&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;94&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre style="overflow:auto;"&gt;&lt;div style="font-family:Courier New;font-size:10pt;color:black;background:white;"&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;95&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;void&lt;/span&gt; GridView_Sorting(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, GridViewSortEventArgs e)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;96&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;97&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// sorting loses the FilterExpression, so we have to restore it&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;98&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (ViewState[&lt;span style="color:#a31515;"&gt;&amp;quot;FilterExpression&amp;quot;&lt;/span&gt;] != &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;99&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;100&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource.FilterExpression = (&lt;span style="color:blue;"&gt;string&lt;/span&gt;)ViewState[&lt;span style="color:#a31515;"&gt;&amp;quot;FilterExpression&amp;quot;&lt;/span&gt;];&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;101&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;102&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;103&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;104&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;void&lt;/span&gt; DataSource_Filtering(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, ObjectDataSourceFilteringEventArgs e)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;105&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;106&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// save the filter expression built when we add a filter, so we can restore it when sort blows it away&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;107&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ViewState[&lt;span style="color:#a31515;"&gt;&amp;quot;FilterExpression&amp;quot;&lt;/span&gt;] = ((ObjectDataSourceView)sender).FilterExpression;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;108&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;109&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;110&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; LoadViewState(&lt;span style="color:blue;"&gt;object&lt;/span&gt; savedState)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;111&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;112&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;base&lt;/span&gt;.LoadViewState(savedState);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;113&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;114&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// clear the saved filter so we don&amp;#39;t restore it if the user sorts&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;115&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (Context.Request.Form[&lt;span style="color:#a31515;"&gt;&amp;quot;__EVENTARGUMENT&amp;quot;&lt;/span&gt;] != &lt;span style="color:blue;"&gt;null&lt;/span&gt; &amp;amp;&amp;amp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;116&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Context.Request.Form[&lt;span style="color:#a31515;"&gt;&amp;quot;__EVENTARGUMENT&amp;quot;&lt;/span&gt;].EndsWith(&lt;span style="color:#a31515;"&gt;&amp;quot;__ClearFilter__&amp;quot;&lt;/span&gt;))&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;117&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;118&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// Clear FilterExpression&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;119&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ViewState.Remove(&lt;span style="color:#a31515;"&gt;&amp;quot;FilterExpression&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;120&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;121&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;122&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre style="overflow:auto;"&gt;&lt;div style="font-family:Courier New;font-size:10pt;color:black;background:white;"&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;123&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;void&lt;/span&gt; DataSource_ObjectCreating(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, ObjectDataSourceEventArgs e)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;124&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;125&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// called by the ObjectDataSource to create an instance of this object&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;126&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.ObjectInstance = &lt;span style="color:blue;"&gt;this&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;127&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;128&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;129&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; CreateChildControls()&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;130&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;131&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// add the ObjectDataSource and SPGridView as children&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;132&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;base&lt;/span&gt;.CreateChildControls();&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;133&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;this&lt;/span&gt;.Controls.Add(DataSource);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;134&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;this&lt;/span&gt;.Controls.Add(GridView);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;135&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;136&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;137&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; OnLoad(&lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;138&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;139&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;base&lt;/span&gt;.OnLoad(e);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;140&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;this&lt;/span&gt;.EnsureChildControls();&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;141&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;142&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;143&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; DataTable SelectData()&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;144&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;145&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;var&lt;/span&gt; e = &lt;span style="color:blue;"&gt;new&lt;/span&gt; GetDataEventArgs();&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;146&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; OnGetData(e);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;147&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; e.DataTable;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;148&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;149&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre style="overflow:auto;"&gt;&lt;div style="font-family:Courier New;font-size:10pt;color:black;background:white;"&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;150&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #region&lt;/span&gt; GetData event+args&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;151&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;GetDataEventArgs&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;152&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;153&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; DataTable DataTable { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;154&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;155&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;event&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;EventHandler&lt;/span&gt;&amp;lt;GetDataEventArgs&amp;gt; GetData;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;156&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;virtual&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; OnGetData(GetDataEventArgs e)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;157&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;158&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;EventHandler&lt;/span&gt;&amp;lt;GetDataEventArgs&amp;gt; eh = GetData;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;159&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (&lt;span style="color:blue;"&gt;null&lt;/span&gt; != eh)&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;160&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;161&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; eh(&lt;span style="color:blue;"&gt;this&lt;/span&gt;, e);&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;162&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;163&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;164&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;165&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp;&amp;nbsp;166&lt;/span&gt;&amp;nbsp;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;Basically, it&amp;rsquo;s a UserControl with an ObjectDataSource and SPGridView wired together and with the events needed to get full sorting/filtering working already in place. To use this, all you have to do in your webpart is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create an instance of SmartSPGridView &lt;/li&gt;
&lt;li&gt;Hook the GetData event and supply the DataTable &lt;/li&gt;
&lt;li&gt;Call DataBind() at the appropriate time (OnPreRender works well) &lt;/li&gt;
&lt;li&gt;Configure and add the view to your webpart (usually in CreateChildControls) 
    
&lt;ul&gt;
&lt;li&gt;Add the columns &lt;/li&gt;
&lt;li&gt;Populate the FilterDataFields property &lt;/li&gt;
&lt;li&gt;Add the view to the webpart&amp;rsquo;s Controls collection &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;ObjectDataSource makes sorting work, FilterDataFields makes filtering work, and several event handlers keep them from tripping over each other. And, I don&amp;rsquo;t have to keep fighting the same battle every time I need this kind of solution for a project. Now, I&amp;rsquo;m off to pick another fight with Sharepoint.&lt;/p&gt;
&lt;p&gt;The downloadable version of the code is linked below.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2782" width="1" height="1"&gt;</description><enclosure url="http://www.rightpoint.com/community/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.00.27.82/SmartSPGridView.zip" length="1982" type="application/zip" /><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SPGridView/default.aspx">SPGridView</category></item><item><title>Datasheet View Extras – Who Knew?</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/03/15/datasheet-view-extras-who-knew.aspx</link><pubDate>Mon, 15 Mar 2010 15:40:18 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2775</guid><dc:creator>Jeremy Williams</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2775</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/03/15/datasheet-view-extras-who-knew.aspx#comments</comments><description>&lt;p&gt;I often tell my clients that I learn something new about SharePoint everyday, and (today) I have the perfect anecdote to prove it!&amp;#160; For those that have already found the sweet toolbar on the datasheet view, the rest of this post may be a bit boring to you; however, if you haven’t found the datasheet view task-pane, read on!&lt;/p&gt;  &lt;p&gt;Recently, I was working on some list items in datasheet view on SharePoint 2007, and I accidentally clicked on the little right arrow on the right side of the datasheet view:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_2.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb.png" width="479" height="208" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Much to my surprise, this handy-dandy little task-pane came zooming out:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_4.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb_5F00_1.png" width="481" height="209" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;While the task-pane doesn’t offer any earth-shattering features, it’s still a handy little tool.&amp;#160; The undo feature is nice to have around, as was the sort option (much easier/quicker than clicking all of the header in an attempt to get the perfect sort).&amp;#160; Also, the ‘Clear Filters’ button was handy as well, and stopped my previous habit of refreshing the browser to get back to a clean-slate on the data sheet viewer.&amp;#160; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2775" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Usability/default.aspx">Usability</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/tool/default.aspx">tool</category></item><item><title>SharePoint 2007 Search Administration: Scheduling and the UI</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/02/19/sharepoint-2007-search-administration-scheduling-and-the-ui.aspx</link><pubDate>Fri, 19 Feb 2010 17:40:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2771</guid><dc:creator>Jeremy Williams</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2771</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/02/19/sharepoint-2007-search-administration-scheduling-and-the-ui.aspx#comments</comments><description>&lt;p&gt;As an SSP administrator, one can control and tweak the many aspects of SharePoint Search.&amp;nbsp; One piece of the puzzle an admin can configure is a content source.&amp;nbsp; For the uninitiated, a content source is simply a location where SharePoint Search is going to go out and look for files.&amp;nbsp; Some examples of content sources could be all of your SharePoint sites, a file share, or even your public website.&amp;nbsp; When configuring a content source, an administrator must choose how often that source will be crawled.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;There are two types of crawls, a full crawl and an incremental crawl.&amp;nbsp; While there is an (almost) infinite number of schedules one could set up for their content source, I often see a full crawl happening relatively infrequently (once a week or month, depending on content size), and incremental crawls happening quite frequently (every 5-60 minutes).&amp;nbsp; Why?&amp;nbsp; Let&amp;rsquo;s say a user uploads a file to SharePoint and tells their buddy, &amp;ldquo;Hey, I just uploaded the document about Client ABC to SharePoint, go check it out!&amp;rdquo;&amp;nbsp; Their buddy (since he doesn&amp;rsquo;t know where the file is located) goes right to his trusty SharePoint search box and searches for &amp;ldquo;Client ABC&amp;rdquo;.&amp;nbsp; If an incremental crawl hasn&amp;rsquo;t run since the file was uploaded, then it won&amp;rsquo;t appear in the results.&amp;nbsp; This in turn makes for frustrated users, and an all around &amp;lsquo;bad&amp;rsquo; SharePoint experience [but alas, I digress..]&lt;/p&gt;
&lt;p&gt;Back to the point, when scheduling an incremental crawl, here&amp;rsquo;s a fairly typical starting point (picture below):&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_2.png"&gt;&lt;img height="285" width="506" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/image_5F00_thumb.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Everything seems to make sense in there, except for the last two text boxes.&amp;nbsp;&amp;nbsp; One way to interpret that section is, &amp;ldquo;Repeat the incremental crawl every 15 minutes and allow it to run for 1440 minutes&amp;rdquo;.&amp;nbsp; Based on this interpretation, one may be lead to believe that an incremental crawl could start and run as long as 1440 minutes (that&amp;rsquo;s 1 full day).&amp;nbsp; Well, as an SSP admin, I would hate for there to (potentially) be 1 crawl each day, so I&amp;rsquo;m going to change that 1440 to 20.&amp;nbsp; Great, I&amp;rsquo;ve got crawl set up and my users should always be able to find their files (relatively) quickly, right? &lt;/p&gt;
&lt;p&gt;Sadly, the answer is No.&amp;nbsp; That text is actually interpreted as, &amp;ldquo;Repeat the incremental crawl every 15 minutes, and continue crawling every 15 minutes for 1440 minutes.&amp;rdquo;&amp;nbsp; So, in my example above, the text becomes, &amp;ldquo;Repeat the incremental crawl every 15 minutes continue crawling every 15 minutes for 20 minutes.&amp;rdquo;&amp;nbsp; This will yield you exactly 2 incremental crawls everyday, one around midnight, and the other around 12:15&amp;hellip;After that, you&amp;rsquo;ll have to wait until midnight rolls around again.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;For some users, this might have been a &amp;ldquo;duh&amp;rdquo; type of post because they interpreted the text and control in the manner Microsoft intended.&amp;nbsp; However, other users may have incorrectly interpreted the text/controls as my example pointed out&amp;hellip;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2771" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/How+it+Works/default.aspx">How it Works</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>MySites and Quotas: The Nuances</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/02/16/mysites-and-quotas-the-nuances.aspx</link><pubDate>Tue, 16 Feb 2010 17:15:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2770</guid><dc:creator>Jeremy Williams</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2770</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/02/16/mysites-and-quotas-the-nuances.aspx#comments</comments><description>&lt;p&gt;Site Quotas in SharePoint 2007 are a great tool, but they can sometimes be misunderstood.&amp;nbsp; One of the most common confusions with quotas comes with their interaction with MySites.&amp;nbsp; MySites (IMHO) are a great feature of SharePoint 2007, and are only getting better in SharePoint 2010.&amp;nbsp; However, the adoption of MySites in many organizations is organic and unplanned.&amp;nbsp; Right around the time that MySites near critical mass, the desire to wrap some additional governance around the sites crops up.&amp;nbsp; Arguably, one of the most obvious governance tools for MySites is a Site Quota.&amp;nbsp; So the governance committee decides on some thresholds and passes the implementation down to their Farm Administrators&amp;hellip;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s put on our &amp;lsquo;Farm Administrator&amp;rsquo; hat&amp;hellip;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I need to enforce a Personal Site quota on my users, so I&amp;rsquo;ll just set up the thresholds on the Personal Site quota template, and apply that to MySites.&amp;nbsp; After that, everyone now has that quota, right? &lt;b&gt;Wrong!&amp;nbsp; &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Okay, so that didn&amp;rsquo;t work and now I&amp;rsquo;m getting yelled at because users are uploading their personal photo and music collections to their MySites, thereby eating up all the space on our SAN.&amp;nbsp; Since editing the quota template didn&amp;rsquo;t do the trick, let&amp;rsquo;s go ahead and create a new template and apply that to MySites.&amp;nbsp; Alright, now everyone has that quota right? &lt;b&gt;Wrong Again!&amp;nbsp; &lt;/b&gt;[Aside: Remember, you can always block certain file extensions from ever being uploaded to SharePoint in Central Administration.]&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;Darn it SharePoint, you&amp;rsquo;re really raining on my parade, what am I doing wrong?!?!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Like many really annoying problems, this boils down to semantics&amp;hellip;Quotas are called &amp;lsquo;Quota Templates&amp;rsquo; for a reason, they are a template, and act just like a&amp;nbsp; site template would.&amp;nbsp; After applying a template, if I make a change to the template, all new sites using the template will take the new values; but the old sites will remain static.&amp;nbsp; Here&amp;rsquo;s a laundry list of nuances, and a quick demo/proof of this behavior:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To reliably change the quotas of MySites, don&amp;rsquo;t create a new template, you&amp;rsquo;ll just want to edit the Personal Site Template.&amp;nbsp; I&amp;rsquo;m not saying that you can&amp;rsquo;t create your own templates, but why work harder if you can work smarter? &lt;/li&gt;
&lt;li&gt;Quotas act like site templates; they&amp;rsquo;re a snapshot&amp;hellip;So if I make site A when personal site quota = 10/8; then I change the quota to 50/40 and create site B, site B quota = 50/40, site A quota = 10/8 &lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t always rely on Central Admin to tell you the truth about site quotas and what a particular collection&amp;rsquo;s quota is; instead use the stsadm &amp;ndash;o enumsites command.&amp;nbsp; Screen-cap below: &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/clip_5F00_image002_5F00_2.jpg"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="clip_image002" alt="clip_image002" src="http://www.rightpointconsulting.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/viewpoint/clip_5F00_image002_5F00_thumb.jpg" border="0" width="511" height="158" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;
&lt;ul&gt;
&lt;li&gt;Administrator was a manually set quota &lt;/li&gt;
&lt;li&gt;Test1 was using the initial Personal Site Template Quota &lt;/li&gt;
&lt;li&gt;Then I changed the Personal Site Template Quota, did an iisreset for good measure, and made test2&amp;rsquo;s MySite. &lt;/li&gt;
&lt;li&gt;So Test 1 and Test 2 used the same template, however they have different values since the template was different during each site&amp;rsquo;s respective build-time. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At the end of the day, the best approach is to properly plan for MySites and enact a reasonable quota template right from the beginning.&amp;nbsp; If that isn&amp;rsquo;t an option, you can customize (or search for other&amp;rsquo;s customizations/extension) stsadm.exe to iterate through MySites and manually apply your new template.&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2770" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Social+Networking/default.aspx">Social Networking</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Social+Computing/default.aspx">Social Computing</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/How+it+Works/default.aspx">How it Works</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>Living in the Social Media Age: Are You?</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/01/11/living-in-the-social-media-age-are-you.aspx</link><pubDate>Mon, 11 Jan 2010 22:20:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2765</guid><dc:creator>jwillinger</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2765</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/01/11/living-in-the-social-media-age-are-you.aspx#comments</comments><description>&lt;div class="post_body"&gt;
&lt;h2&gt;&lt;a href="http://mattroyse.wordpress.com/2009/09/20/living-in-the-social-media-age/" title="Permanent Link to Living in the Social Media&amp;amp;nbsp;Age"&gt;&lt;span style="color:#0080c3;"&gt;Living in the Social Media&amp;nbsp;Age&lt;/span&gt;&lt;/a&gt;: Are You?&lt;/h2&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;More than 56% of marketers plan to incorporate social media into their businesses next year, according to a recent &lt;a target="_blank" href="http://www.bizreport.com/2009/09/social_media_on_marketers_menu_for_2010.html"&gt;&lt;span style="color:#0080c3;"&gt;survey&lt;/span&gt;&lt;/a&gt; by the Center for Media Research.
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With so many social media channel options to choose from, which one do you use for your marketing communications strategy?&lt;/p&gt;
&lt;p&gt;In July 2009, Russell Herder and Ethos Business Law &lt;a target="_blank" href="http://www.russellherder.com/SocialMediaResearch/%29"&gt;&lt;span style="color:#0080c3;"&gt;study&lt;/span&gt;&lt;/a&gt; of national business leaders highlighted that the most popular social media channels were the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.facebook.com/home.php"&gt;&lt;span style="color:#0080c3;"&gt;Facebook&lt;/span&gt;&lt;/a&gt; (80%)&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://twitter.com/"&gt;&lt;span style="color:#0080c3;"&gt;Twitter &lt;/span&gt;&lt;/a&gt;(66%)&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.youtube.com/"&gt;&lt;span style="color:#0080c3;"&gt;YouTube &lt;/span&gt;&lt;/a&gt;(55%)&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.linkedin.com/"&gt;&lt;span style="color:#0080c3;"&gt;LinkedIn&lt;/span&gt;&lt;/a&gt; (49%)&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://blogsearch.google.com/"&gt;&lt;span style="color:#0080c3;"&gt;Blogs&lt;/span&gt;&lt;/a&gt; (43%)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In my first blog post, my audience confirmed that Facebook and Twitter were the most popular social media platforms.&amp;nbsp; So, as a marketer, should I use the most popular social media channel or a combination of both?&amp;nbsp; Well, the short answer is that it depends.&amp;nbsp; Since each tool works in a different way and with the social media landscape changing everyday, the key is to find out what your targeted audience likes to use.&lt;/p&gt;
&lt;p&gt;The bottom line is that you need to be a part of A conversation because these conversations are happening, whether you are in the social media game or not.&amp;nbsp; My next post will be focused more around SharePoint as that platform for an enterprise to build that social computing platform upon.&lt;/p&gt;
&lt;/p&gt;
&lt;div class="posterousGalleryMainDiv" id="HHnBugyxGf"&gt;&lt;img height="390" width="465" src="http://posterous.com/getfile/files.posterous.com/jwillie/vhsc5eoyq9yOBCy4oQvjFrqiX4PrFHidHTKKEqtY1qYv7Oq01EsS4tC13Es2/image001.gif" alt="" /&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;div class="comment-area" id="post_commentarea_9772133"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2765" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/twitter/default.aspx">twitter</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/YouTube/default.aspx">YouTube</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/LinkedIN/default.aspx">LinkedIN</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Facebook/default.aspx">Facebook</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Blogs/default.aspx">Blogs</category></item><item><title>401 Reasons Why SharePoint Web Services Don't Work Anonymously</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/01/07/401-reasons-why-sharepoint-web-services-don-t-work-anonymously.aspx</link><pubDate>Thu, 07 Jan 2010 06:43:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2762</guid><dc:creator>Chris Domino</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2762</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/01/07/401-reasons-why-sharepoint-web-services-don-t-work-anonymously.aspx#comments</comments><description>&lt;p class="Text"&gt;&lt;span class="Rant"&gt;&amp;lt;RANT&amp;gt;&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;I am always weary of using third party controls in my solutions. I feel that the risk of slightly reinventing the wheel is much less severe than that of getting to the end of project and realizing that some minor requirement that the control in use doesn&amp;#39;t support will become a show stopper. When you don&amp;#39;t have 100% control over your functionality (or the time/budget to customize open source code) then you had better make damn sure your third party components either &lt;span class="Bold"&gt;FIT PERFECTLY&lt;/span&gt; or that your client won&amp;#39;t mind cutting features. &lt;/p&gt;
&lt;p class="Text"&gt;That&amp;#39;s why when I party with SharePoint, it&amp;#39;s always &amp;quot;first party.&amp;quot; Who wants to go to a &lt;span class="Italic"&gt;third&lt;/span&gt; party when the first party is way cooler? &lt;/p&gt;
&lt;p class="Text"&gt;&lt;span class="Rant"&gt;&amp;lt;/RANT&amp;gt;&lt;/span&gt; &lt;/p&gt;
&lt;p class="Text"&gt;That said, I ran into such an issue in my last project. We were using a third party tool that, at the 11th hour (or, more accurately, around 9:45) immediately failed when we were informed that its SharePoint site had to be anonymous. Now our client probably pushed this requirement to the back burner because the functionality of this component had nothing to do with authorization. (I am purposely not going to share which component it is, because, well, I&amp;#39;m not a douche.) &lt;/p&gt;
&lt;p class="Text"&gt;The problem is that OOTB SharePoint web services, at least the ones this web part was calling, do not support anonymous access. The two in question here are SiteData.asmx and List.asmx. However, the depth of this unsupportedness far exceeded my expectations - as you&amp;#39;ll see. &lt;/p&gt;
&lt;p class="Text"&gt;The client first noticed the problem when &amp;quot;random pages&amp;quot; would challenge for credentials exactly twice, which is of course two more times than an anonymous site should challenge anyone. These random pages were of course the ones containing the web part in question. So I fired up &lt;a target="_blank" href="http://fiddler2.com/fiddler2/" class="Link"&gt;Fiddler&lt;/a&gt; and immediately saw the two 401s resulting from calls to the aforementioned web services. &lt;/p&gt;
&lt;p class="Text"&gt;&amp;quot;Easy fix,&amp;quot; I thought as I remoted into the server and fired up IIS. Once there, I navigated to the web site corresponding to the web app in question, expanded it, and set the _vti_bin virtual directory to anonymous, using the app pool identity for impersonation. &lt;/p&gt;
&lt;p class="Text"&gt;And shazzam, no more challenges! &lt;/p&gt;
&lt;p class="Text"&gt;Now the next day, heading to the status meeting, I prepared myself for praise and glory resulting from my victory over yet another third party control&amp;#39;s nonsensical way of doing things. I mean, come on! This is a web part; this is server side code. ALWAYS. Why call the web services? Why not just use the API? If this was our code, I could just fix it, or at least have an arch-to-arch heart-to-heart and inquire as to why this was the chosen method, as there could have been some weird requirement or dependency of doing things that way. &lt;/p&gt;
&lt;p class="Text"&gt;But I&amp;#39;m a consultant. Every project is an edge case in some way. That&amp;#39;s why third party controls fail me so often. &lt;/p&gt;
&lt;p class="Text"&gt;So I sat down at the meeting, and was immediately informed that, despite the lack of challenges, there was still &amp;quot;something wrong&amp;quot; with the web part. It was scarcely noticeable, but still not right. So I went back to Fiddler, and indeed saw that 401s were still being returned. Looking into the raw HTTP, I noticed that only one line of text was being returned: &amp;quot;401 UNAUTHORIZED.&amp;quot; &lt;/p&gt;
&lt;p class="Text"&gt;I then flipped _vti_bin back to Windows auth, and saw the challenges again. Back in Fiddler - and here&amp;#39;s the interesting part - I saw the familiar markup of IE&amp;#39;s default 401 error page! This makes sense; IIS wants windows credentials, IE didn&amp;#39;t give it any, so it returns a 401, and the web service call fails and dies quietly. &lt;/p&gt;
&lt;p class="Text"&gt;But when anonymous is set, we get that one line message: &amp;quot;401 UNAUTHORIZED.&amp;quot; Obviously, this is not coming from IIS. My only guess, after going through the trouble of &lt;a target="_blank" href="http://www.red-gate.com/products/reflector/" class="Link"&gt;Reflecting&lt;/a&gt; what I could of Microsoft.SharePoint.dll, is that code inside the web method sends this response if the current user is not authenticated, regardless if it&amp;#39;s virtual directory is set to be anonymous. Here&amp;#39;s what I dug up in Reflector: &lt;/p&gt;
&lt;p class="Text"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="Image"&gt;&lt;img src="http://chrisdomino.com/content/images/401-Reasons-Why-SharePoint-Web-Services-Dont-Work-Anonymously/Reflector.jpg" class="Image" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="Text"&gt;Note: I couldn&amp;#39;t get the actual web service code loaded into Reflector, so I can&amp;#39;t be sure about this assumption. I tried OWSSVR.dll, which lives in the ISAPI folder in the SharePoint hive, but Reflector couldn&amp;#39;t load it since it does not contain a CLI header. &lt;/p&gt;
&lt;p class="Text"&gt;So that&amp;#39;s&amp;nbsp;a dead end: it appears as though the OOTB SharePoint web services explicitly send 401 responses even if their virtual directory is set to be anonymous. This is certainly, IMHO, another knock against using them for anything server side. Maybe that&amp;#39;s why it was so hard to get them to work in InfoPath 2003... &lt;/p&gt;
&lt;p class="Text"&gt;However, SharePoint 2010 is upon us! Next step: see if this is still an issue in the new product. &lt;/p&gt;
&lt;p class="Text"&gt;Stay tuned! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2762" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Anonymous/default.aspx">Anonymous</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Web+Service/default.aspx">Web Service</category></item><item><title>5 of the 10 Best Intranets in the World Run SharePoint</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/01/06/5-of-the-10-best-intranets-in-the-world-run-sharepoint.aspx</link><pubDate>Wed, 06 Jan 2010 22:07:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2761</guid><dc:creator>jwillinger</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2761</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2010/01/06/5-of-the-10-best-intranets-in-the-world-run-sharepoint.aspx#comments</comments><description>&lt;p&gt;Jakob Nielsen, the world&amp;#39;s leading expert on Web usability has listed his best in class intranets.&amp;nbsp; It is no surprise that half of the sites were developed in SharePoint, which i live and breathe daily.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;SharePoint 2010 is the business collaboration platform that enables you to connect and empower people through formal and informal business communities, within the enterprise and beyond, and to manage content throughout the information lifecycle. Whether deployed on-premises or as hosted services, SharePoint&amp;rsquo;s integrated capabilities are enhanced by search technologies&amp;nbsp;and enable you to rapidly respond to changing business needs by making data-driven decisions and by deploying customized solutions quickly and securely. The consolidation of collaboration solutions onto SharePoint 2010 makes it possible to cut costs by lowering training and maintenance expenses and increasing IT productivity, all within a governable and compliant platform. &lt;/p&gt;
&lt;p&gt;10 Best Intranets of 2009 &lt;/p&gt;
&lt;p&gt;Summary:&lt;br /&gt;Intranets are getting more strategic, with increased collaboration support. Team size is growing by 12% per year, and platforms are becoming integrated, with a strong showing for SharePoint. Improving usability increased use by 106% on average. &lt;/p&gt;
&lt;p&gt;The winners of the award for 10 best-designed intranets for 2009 are: &lt;/p&gt;
&lt;p&gt;Altran, a large engineering and innovation consultancy (France)&lt;br /&gt;Advanced Micro Devices (AMD), a developer of computer and graphics processors (USA)&lt;br /&gt;BASF SE, the world&amp;#39;s leading chemical manufacturing company (Germany)&lt;br /&gt;COWI Group A/S, a consulting group focusing on engineering, environmental science, and economics (Denmark)&lt;br /&gt;Deloitte Touche Tohmatsu (DTT), a global professional services network providing audit, tax, consulting, and financial advisory services (a Global member organization)&lt;br /&gt;Environmental Resources Management (ERM), one of the world&amp;#39;s leading providers of environmental consulting services (Global)&lt;br /&gt;HSBC Bank Brazil (Brazil)&lt;br /&gt;Kaupthing Bank (Iceland)&lt;br /&gt;L.L.Bean, a vendor of apparel and outdoor equipment (USA)&lt;br /&gt;McKesson Corporation, a large provider of pharmaceuticals, medical supplies, and health care information technologies (USA) &lt;/p&gt;
&lt;p&gt;Deloitte Touche Tohmatsu also won in 2002 for its Australian member firm&amp;#39;s intranet; this year, DTT&amp;#39;s worldwide intranet is the winner. As such, DTT joins a very small, elite group of companies that has won the award twice: Cisco Systems is the only other member. &lt;/p&gt;
&lt;p&gt;As we&amp;#39;ve seen every year, great intranets are found around the world and in all industries. This year, we have our first winner from Latin America. We also have the first winners from Denmark, France, and Iceland; Germany and the U.S. have both provided many winners in the past. We have one other first this year: In a sign of ongoing globalization trends, we have winners that are not headquartered in any individual country. &lt;/p&gt;
&lt;p&gt;The consulting sector is this year&amp;#39;s best-represented industry, with 3 winners. Given the knowledge-intensive nature of consulting and this year&amp;#39;s trend toward more collaboration-focused intranets, this fact makes sense. &lt;/p&gt;
&lt;p&gt;Bigger Intranet Budgets &lt;/p&gt;
&lt;p&gt;As we&amp;#39;ve seen the last few years, large companies dominate among the winners. Among this year&amp;#39;s winners, the average organization has 37,500 employees. Even so, fairly small companies like Kaupthing Bank with 3,200 employees can still win. Good user experience doesn&amp;#39;t require size or humongous budgets; it requires talent and emphasis on meeting the users&amp;#39; needs. &lt;/p&gt;
&lt;p&gt;One of the strongest trends over the years that we&amp;#39;ve run this design competition is that intranet teams have been getting bigger. As the following chart shows, when we started honoring intranet projects in 2001, the average winning team had 6 members; today, the average team size is 14. &lt;/p&gt;
&lt;p&gt;The long-term trend is toward bigger intranet teams, with a growth rate of 12% per year. &lt;/p&gt;
&lt;p&gt;Still, what holds for company size also holds for the size of teams: You don&amp;#39;t have to be big to win. This year&amp;#39;s winners include one team with 5 members and another team with 6 members. In earlier years, we&amp;#39;ve honored winners with 1- or 2-person teams. &lt;/p&gt;
&lt;p&gt;Even this year&amp;#39;s average team size of 14 is fairly small when it comes to providing a key work tool for organizations with 37,500 employees on average. One way to leverage intranet staff is to call on external resources as appropriate. Today, the predominant approach to running intranet design projects is to engage one or more consultants and external agencies to contribute parts &amp;mdash; and only parts &amp;mdash; of the design, while keeping overall control inside the company itself. &lt;/p&gt;
&lt;p&gt;This year, 6 of the 10 winners were designed by some combination of in-house and outside resources. The remaining 4 projects were done completely by the company&amp;#39;s own staff. None of the winning intranets were designed exclusively by an external agency, even though this was a fairly common approach in earlier years. &lt;/p&gt;
&lt;p&gt;It&amp;#39;s a healthy trend for companies to take more ownership of their intranets and devote resources to building sufficiently large intranet teams. In so doing, they gain in-house expertise in the main areas of intranet user experience. Not all companies can afford intranet teams that are big enough to do everything on their own, however. And, in any case, there are at least three reasons to periodically engage outsiders: &lt;/p&gt;
&lt;p&gt;To get a fresh, independent perspective. People who work on the same project for years can become too accustomed to a certain way of doing things. (Disclaimer: Because Nielsen Norman Group sometimes serves this role through impartial usability reviews or unbiased user testing, we might certainly be too sympathetic to the value of an outside perspective.)&lt;br /&gt;To provide deep expertise or a narrow skill set that the intranet team cannot justify adding to their permanent, full-time headcount.&lt;br /&gt;To alleviate workload during crunch times, particularly during large redesign projects or rollouts. &lt;/p&gt;
&lt;p&gt;Strategic Intranets &lt;/p&gt;
&lt;p&gt;Bigger intranet teams and increasing internal ownership of the intranet user experience both reflect the intranet&amp;#39;s growing strategic role in supporting work processes. &lt;/p&gt;
&lt;p&gt;Intranets today do much more than simply host the company phone book and HR manuals &amp;mdash; though these components remain critically important, and teams are continuing to improve them. COWI, for example, supplemented employee profiles with a feature that highlights commonalities between directory users and the profiled employees they view (an interesting combination of personalization, social networking, and the traditional staff directory.) &lt;/p&gt;
&lt;p&gt;Nonetheless, with bigger teams and budgets and increased respect and strategic recognition, intranet functionality is expanding beyond such basic features. A simple statistic to quantify this trend is the fact that, at 473 pages, this year&amp;#39;s Intranet Design Annual is the most voluminous ever (326% longer than the first Design Annual in 2001, and 31% longer than last year&amp;#39;s report). As intranet teams accomplish more, more space is required to document the winning designs. &lt;/p&gt;
&lt;p&gt;Another indication of the intranet&amp;#39;s growing strategic importance is the fact that ERM is the first winning team that reports directly to the company chairman. As in past years, most other winners report to either Corporate Communications or IT, and having teams report to the top isn&amp;#39;t likely to become commonplace. But this year does show dramatically increased executive visibility for the intranet in many of the winning organizations. This executive involvement typically results from companies viewing the intranet as a collaboration tool and appreciating the increased business efficiency that a good intranet brings. &lt;/p&gt;
&lt;p&gt;Collaboration Features &lt;/p&gt;
&lt;p&gt;This year&amp;#39;s winners showed a substantial increase in both collaboration support and social networking features. Although inspired by the open Internet&amp;#39;s &amp;quot;Web 2.0&amp;quot; sites, these features often have a much stronger business model within the enterprise, simply because they&amp;#39;re more useful and less subject to noise and information pollution by bozos. &lt;/p&gt;
&lt;p&gt;The most symbolic instantiation of this trend might be at Deloitte Touche Tohmatsu, where employees can add their own videos to the corporate TV network. Quite the enterprise YouTube. &lt;/p&gt;
&lt;p&gt;Teams are also adding Facebook-like features to employee directories to enrich the profiles. That said, the designs are for a work environment &amp;mdash; not for commenting on personal photos or supporting teenage dating behaviors. So, while it&amp;#39;s appropriate to be inspired by popular social networking websites, your actual user interface and features must be freshly designed specifically for the intranet. Internal blogs &amp;mdash; whether by employees, department heads, or company leaders &amp;mdash; were also thicker on the ground than in previous years. &lt;/p&gt;
&lt;p&gt;The vast majority of our winning intranets feature CEO blogs. This is not new; we&amp;#39;ve seen some CEO blogs in earlier years. Indeed, HSBC Bank Brazil&amp;#39;s CEO blog started in 2005 and has since been viewed more than 2 million times and accumulated 8,000 employee comments. These statistics imply about 1 comment for every 250 employee viewings of the CEO blog, a level that&amp;#39;s consistent with other research on user participation in online communities. You can use this level as a rough benchmark to assess whether your own CEO blog is sufficiently inviting of employee participation. &lt;/p&gt;
&lt;p&gt;Clearly, it&amp;#39;s a well-established feature. What&amp;#39;s new this year is the sheer prevalence of this communications tool; we now have enough good examples to specify 9 guidelines for an intranet CEO blog. &lt;/p&gt;
&lt;p&gt;Another example of a striking social feature is ERM&amp;#39;s interactive forum. This tool has achieved mission-critical status in allowing consultants to post urgent requests for advice from their colleagues around the world. The forum has virtually eliminated panicky broadcast emails at ERM, thus improving the productivity of the many knowledge workers who are no longer interrupted by requests that they might have no qualifications or experience to solve. Even more important, this community feature often helps the company quickly construct better proposals for key clients on short deadlines. &lt;/p&gt;
&lt;p&gt;Personalization and Customization &lt;/p&gt;
&lt;p&gt;As many of this year&amp;#39;s winners show, intranet personalization is becoming increasingly sophisticated. The leading application of personalization is to provide each employee with news updates focused on their job role and personal interests. If intranets show everyone everything, information overload ensues and people either ignore the news area or squander their time reading irrelevant stories. &lt;/p&gt;
&lt;p&gt;Simple customization can often generate sizeable productivity wins. For example, at McKesson, sales people can create a My Product List and My Favorite Reports, freeing them from having to wade through the much longer lists of all available options. Much appreciated when you&amp;#39;re on the phone with a customer and would prefer to focus your mental resources on closing the sale, rather than navigating the intranet. &lt;/p&gt;
&lt;p&gt;At AMD, users can customize links directly in the main menu bar, which integrates the user&amp;#39;s personal favorites much more tightly with the intranet navigation than the traditionally separate Quick Links feature. &lt;/p&gt;
&lt;p&gt;Multilingual intranets also make good use of personalization to increase usability by presenting pages in the user&amp;#39;s preferred language as much as possible. BASF&amp;#39;s main user interface elements are available in 13 different languages, and several other winners also have internationalization and localization support that goes far beyond what we see in most Internet websites. &lt;/p&gt;
&lt;p&gt;Technology Platform: Unification Begins &lt;/p&gt;
&lt;p&gt;In all previous years, the only conclusion regarding technology was that there was no universal platform for designing good intranets. Winners typically used an extraordinarily wide diversity of implementation packages. &lt;/p&gt;
&lt;p&gt;Although this conclusion continues to hold this year, it is less pronounced. &lt;/p&gt;
&lt;p&gt;Among the winning intranets, many are built on a single intranet platform that integrates most of the supporting features they need &amp;mdash; including a content management system (CMS) and search. Some winners supplement their main platform with a few selected tools for specialized purposes &amp;mdash; mainly Web analytics. If we were to hazard a prediction, it would be that traffic statistics, search log analysis, and other analytics tools will be substantially beefed up and integrated in future releases of the main intranet software platforms. &lt;/p&gt;
&lt;p&gt;In total, the 10 winners were built on 26 different products &amp;mdash; substantially fewer than the 41 used in 2008 or the 49 used in 2007. Most impressively, fully half of the winning intranets used SharePoint, especially the recent MOSS platform (Microsoft Office SharePoint Server 2007). As the following chart shows, SharePoint use has grown dramatically in recent years. This is particularly impressive given that, from 2003&amp;ndash;2006, the winning intranets didn&amp;#39;t use earlier versions of SharePoint at all. &lt;/p&gt;
&lt;p&gt;Microsoft SharePoint has seen substantially increased use among well-designed intranets in recent years.&lt;br /&gt;(In 2007, Microsoft&amp;#39;s own intranet was a winner, and they obviously used their own software, so the 2007 dot should be a notch lower if you consider only third-party projects.) &lt;/p&gt;
&lt;p&gt;Despite this big growth in SharePoint use among the best intranets, the contest is far from over for intranet software platforms. Many other good enterprise software vendors offer widely used solutions. This year, for example, multiple winners used Autonomy, Google Search, and WebTrends. &lt;/p&gt;
&lt;p&gt;Usability Growth &lt;/p&gt;
&lt;p&gt;Over our intranet award&amp;#39;s 9-year history, we&amp;#39;ve seen a steady increase in user-centered design. The following chart shows the proportion of winning intranets that employed various methods across three different 3-year periods. The use of all methods has substantially increased; it&amp;#39;s particularly gratifying to see the extent to which designers are embracing paper prototyping and other low-cost testing methods. &lt;/p&gt;
&lt;p&gt;The percent of winning intranets that employed some of the main usability methods in their design process. &lt;/p&gt;
&lt;p&gt;To assess the ROI of intranet redesigns, teams primarily relied on usage metrics in terms of users, visits, or page views. Across this year&amp;#39;s winners, the average increase in intranet use was 106%. This is about the same as we&amp;#39;ve seen in previous years: The average usage increase in the 2005&amp;ndash;2008 winners was 110%. So, roughly speaking, improving an intranet&amp;#39;s usability will double its use. &lt;/p&gt;
&lt;p&gt;L.L.Bean conducted a benchmark study comparing their old and new designs. The old intranet had a success rate of 67% and an average time-on-task of 1 minute and 52 seconds. The new intranet has a success rate of 88% and users require only 54 seconds on average to perform the same tasks. In other words, users can perform more than twice as many tasks per hour with the new design. This improvement is somewhat more than the average across our intranet usability metrics benchmarks, but then L.L.Bean does have an award-winning intranet. &lt;/p&gt;
&lt;p&gt;I am Director of Business Development and Marketing at Rightpoint, the country&amp;#39;s premier SharePoint knowledge repository with end to end solutions around everything SharePoint.&amp;nbsp; You can reach me at &lt;a href="mailto:jwillinger@rightpoint.com"&gt;&lt;span style="color:#0080c3;"&gt;jwillinger@rightpoint.com&lt;/span&gt;&lt;/a&gt; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2761" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Rightpoint/default.aspx">Rightpoint</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Web+2.0/default.aspx">Web 2.0</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Usability/default.aspx">Usability</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Social+Computing/default.aspx">Social Computing</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Collaboration/default.aspx">Collaboration</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Portal/default.aspx">Portal</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Intranet/default.aspx">Intranet</category></item><item><title>Extending SharePoint Approval Workflows Using Custom Initialization And Association Data</title><link>http://www.rightpoint.com/community/blogs/viewpoint/archive/2009/12/30/test.aspx</link><pubDate>Wed, 30 Dec 2009 17:15:00 GMT</pubDate><guid isPermaLink="false">f7450ba4-a08e-465a-831a-f9a15c21b696:2758</guid><dc:creator>Chris Domino</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.rightpoint.com/community/blogs/viewpoint/rsscomments.aspx?PostID=2758</wfw:commentRss><comments>http://www.rightpoint.com/community/blogs/viewpoint/archive/2009/12/30/test.aspx#comments</comments><description>&lt;p class="Text"&gt;It is always with a bit of hesitation that I recommend using Out-Of-The-Box SharePoint Workflows to my clients. It&amp;#39;s not because they are exactly terrible or anything; it&amp;#39;s just another application of the 80-20 rule. And since I take such good care of my clients, they seem to become fairly well acclimated to never hearing phrases like &amp;quot;No&amp;quot; or &amp;quot;That&amp;#39;s out of scope&amp;quot; or &amp;quot;That&amp;#39;s not in the budget&amp;quot; or &amp;quot;No thanks, I&amp;#39;ve already eaten.&amp;quot; &lt;/p&gt;
&lt;p class="Text"&gt;So when the need arises for a quickie approval process on a document library or list, the OOTB Approval Workflow should bubble into your mind immediately. But as soon as a client squeaks about some minor customization here, or drops a &amp;quot;would it be possible&amp;quot; there, the bubble will quickly pop, sending you off to Visual Studio 2008 and the WF Workflow Designer, ultimately reinventing about ninety percent of the wheel. &lt;/p&gt;
&lt;p class="Text"&gt;Despite the fact that there are a lot of configuration options for the OOTB SharePoint workflows, modeling a business process is so specific to an organization&amp;#39;s way of doing things that a generic &amp;quot;Approval&amp;quot; workflow can rarely be expected to get the job done. Except for the most remedial cases, the Approval workflow is not a panacea for content approval. &lt;/p&gt;
&lt;p class="Text"&gt;However, that doesn&amp;#39;t mean that it&amp;#39;s time to immediately build a workflow from scratch! By using the SharePoint workflow API and some nifty manipulations of the Association and Initialization data, we can leverage the OOTB Approval workflow and customize, or, more accurately, &lt;span class="Italic"&gt;force&lt;/span&gt; it to do what we need. &lt;/p&gt;
&lt;p class="Text"&gt;One customization that always seems to come up is assigning a dynamic approver to an instance of an Approval workflow. On the association screen, you can specify a list of static approvers, but that&amp;#39;s really it. If your workflow is set to kick off automatically (via an &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemadded.aspx" class="Link"&gt;ItemAdded&lt;/a&gt; or &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemupdated.aspx" class="Link"&gt;ItemUpdated&lt;/a&gt; event), there&amp;#39;s no opportunity to specify initialization data for that instance. &lt;/p&gt;
&lt;p class="Text"&gt;So what I&amp;#39;m going to show is how to programmatically create and start an instance of an Approval workflow with custom initialization data that is built from metadata on the list that the workflow is associated with. Let&amp;#39;s start by an overview of the architecture of this scenario: &lt;/p&gt;
&lt;p class="Text"&gt;&lt;ol class="Text"&gt;
&lt;li class="Text"&gt;A custom list is associated with the Approval workflow. One of the columns is of type &amp;quot;Person&amp;quot; which accepts an &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spuser.aspx" class="Link"&gt;SPUser&lt;/a&gt; object. This user will be the approver of the instance of this workflow.&lt;/li&gt;
&lt;li class="Text"&gt;A custom web part captures data from a user, and creates an item in a list. &lt;/li&gt;
&lt;li class="Text"&gt;A Feature provisions the above list, and welds on the Approval workflow with custom Association data.&lt;/li&gt;
&lt;li class="Text"&gt;Event receivers are installed for the custom list as well as the task list the workflow uses. These will kick off the workflow, and execute code when it is approved.&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p class="Text"&gt;Taking the last item first, here&amp;#39;s some sample code for a feature receiver&amp;#39;s &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfeaturereceiver.featureactivated.aspx" class="Link"&gt;FeatureActivated&lt;/a&gt; event, scoped at the site level: &lt;/p&gt;
&lt;p class="Text"&gt;
&lt;table cellpadding="0" cellspacing="0" class="CodeLayout"&gt;
&lt;tbody&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellTopLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellMiddleLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellMiddleLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleMiddle"&gt;
&lt;div class="CodeContainer"&gt;
&lt;div class="CodeLayout"&gt;&lt;ol class="Code"&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;public&lt;/span&gt; &lt;span class="Keyword"&gt;override&lt;/span&gt; &lt;span class="Keyword"&gt;void&lt;/span&gt; FeatureActivated&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPFeatureReceiverProperties&lt;/span&gt; properties&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//open site&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;using&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPSite&lt;/span&gt; site &lt;span class="Operator"&gt;=&lt;/span&gt; properties&lt;span class="Operator"&gt;.&lt;/span&gt;Feature&lt;span class="Operator"&gt;.&lt;/span&gt;Parent &lt;span class="Keyword"&gt;as&lt;/span&gt; &lt;span class="ClassName"&gt;SPSite&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//open web&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;site&lt;span class="Operator"&gt;.&lt;/span&gt;AllowUnsafeUpdates &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;true&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;using&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPWeb&lt;/span&gt; web &lt;span class="Operator"&gt;=&lt;/span&gt; site&lt;span class="Operator"&gt;.&lt;/span&gt;RootWeb&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//create list for workflow&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;web&lt;span class="Operator"&gt;.&lt;/span&gt;AllowUnsafeUpdates &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;true&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPList&lt;/span&gt; list &lt;span class="Operator"&gt;=&lt;/span&gt; web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;[&lt;/span&gt;web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Request List&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;This list holds the requests to be approved.&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="ClassName"&gt;SPListTemplateType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;GenericList&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//add fields to list&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;List&lt;/span&gt;&lt;span class="Operator"&gt;&amp;lt;&lt;/span&gt;&lt;span class="ClassName"&gt;SPField&lt;/span&gt;&lt;span class="Operator"&gt;&amp;gt;&lt;/span&gt; fields &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;new&lt;/span&gt; &lt;span class="ClassName"&gt;List&lt;/span&gt;&lt;span class="Operator"&gt;&amp;lt;&lt;/span&gt;&lt;span class="ClassName"&gt;SPField&lt;/span&gt;&lt;span class="Operator"&gt;&amp;gt;&lt;/span&gt;&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;fields&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;list&lt;span class="Operator"&gt;.&lt;/span&gt;Fields&lt;span class="Operator"&gt;.&lt;/span&gt;GetFieldByInternalName&lt;span class="Operator"&gt;(&lt;/span&gt;list&lt;span class="Operator"&gt;.&lt;/span&gt;Fields&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Client Name&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="ClassName"&gt;SPFieldType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;Text&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Keyword"&gt;true&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//hide title&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPField&lt;/span&gt; title &lt;span class="Operator"&gt;=&lt;/span&gt; list&lt;span class="Operator"&gt;.&lt;/span&gt;Fields&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;title&lt;span class="Operator"&gt;.&lt;/span&gt;Required &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;false&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;title&lt;span class="Operator"&gt;.&lt;/span&gt;Hidden &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;true&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;title&lt;span class="Operator"&gt;.&lt;/span&gt;Update&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//add approver field&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPField&lt;/span&gt; field &lt;span class="Operator"&gt;=&lt;/span&gt; list&lt;span class="Operator"&gt;.&lt;/span&gt;Fields&lt;span class="Operator"&gt;.&lt;/span&gt;GetFieldByInternalName&lt;span class="Operator"&gt;(&lt;/span&gt;list&lt;span class="Operator"&gt;.&lt;/span&gt;Fields&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Approver&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="ClassName"&gt;SPFieldType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;User&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Keyword"&gt;false&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;field&lt;span class="Operator"&gt;.&lt;/span&gt;Hidden &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;true&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;field&lt;span class="Operator"&gt;.&lt;/span&gt;Update&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//create lists for workflow tasks and history&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPList&lt;/span&gt; tasks &lt;span class="Operator"&gt;=&lt;/span&gt; web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;[&lt;/span&gt;web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Workflow Tasks&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;This list holds the tasks used for the Request workflow approvals.&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="ClassName"&gt;SPListTemplateType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;Tasks&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Workflow History&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;This list holds the historical data for Request workflows.&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="ClassName"&gt;SPListTemplateType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;WorkflowHistory&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//get workflow association&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPWorkflowTemplate&lt;/span&gt; wk &lt;span class="Operator"&gt;=&lt;/span&gt; web&lt;span class="Operator"&gt;.&lt;/span&gt;WorkflowTemplates&lt;span class="Operator"&gt;.&lt;/span&gt;GetTemplateByName&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Approval&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Keyword"&gt;new&lt;/span&gt; &lt;span class="ClassName"&gt;CultureInfo&lt;/span&gt;&lt;span class="Operator"&gt;(&lt;/span&gt;1033&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPWorkflowAssociation&lt;/span&gt; association &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="ClassName"&gt;SPWorkflowAssociation&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;CreateListAssociation&lt;span class="Operator"&gt;(&lt;/span&gt;wk&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;Request Approval Workflow&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Workflow Tasks&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Workflow History&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//configure workflow&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;association&lt;span class="Operator"&gt;.&lt;/span&gt;AllowManual &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;false&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;association&lt;span class="Operator"&gt;.&lt;/span&gt;AutoStartCreate &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;false&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;association&lt;span class="Operator"&gt;.&lt;/span&gt;AutoStartChange &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;false&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;association&lt;span class="Operator"&gt;.&lt;/span&gt;AllowAsyncManualStart &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;false&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;association&lt;span class="Operator"&gt;.&lt;/span&gt;AssociationData &lt;span class="Operator"&gt;=&lt;/span&gt; association&lt;span class="Operator"&gt;.&lt;/span&gt;AssociationData&lt;span class="Operator"&gt;.&lt;/span&gt;Replace&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;&amp;lt;my:AllowDelegation&amp;gt;true&amp;lt;/my:AllowDelegation&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;&amp;lt;my:AllowDelegation&amp;gt;false&amp;lt;/my:AllowDelegation&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;association&lt;span class="Operator"&gt;.&lt;/span&gt;AssociationData &lt;span class="Operator"&gt;=&lt;/span&gt; association&lt;span class="Operator"&gt;.&lt;/span&gt;AssociationData&lt;span class="Operator"&gt;.&lt;/span&gt;Replace&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;&amp;lt;my:AllowChangeRequests&amp;gt;true&amp;lt;/my:AllowChangeRequests&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;&amp;lt;my:AllowChangeRequests&amp;gt;false&amp;lt;/my:AllowChangeRequests&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;list&lt;span class="Operator"&gt;.&lt;/span&gt;AddWorkflowAssociation&lt;span class="Operator"&gt;(&lt;/span&gt;association&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//wire up event handlers&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;list&lt;span class="Operator"&gt;.&lt;/span&gt;EventReceivers&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPEventReceiverType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;ItemAdded&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;Request, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97c72abbf6e1c840&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;Request.EventHandlers&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;tasks&lt;span class="Operator"&gt;.&lt;/span&gt;EventReceivers&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPEventReceiverType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;ItemUpdated&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;Request, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97c72abbf6e1c840&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Constant"&gt;&amp;quot;Request.EventHandlers&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;tasks&lt;span class="Operator"&gt;.&lt;/span&gt;Update&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//update main view&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPView&lt;/span&gt; view &lt;span class="Operator"&gt;=&lt;/span&gt; list&lt;span class="Operator"&gt;.&lt;/span&gt;Views&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;All Items&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;view&lt;span class="Operator"&gt;.&lt;/span&gt;ViewFields&lt;span class="Operator"&gt;.&lt;/span&gt;DeleteAll&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;foreach&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPField&lt;/span&gt; f &lt;span class="Keyword"&gt;in&lt;/span&gt; fields&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;view&lt;span class="Operator"&gt;.&lt;/span&gt;ViewFields&lt;span class="Operator"&gt;.&lt;/span&gt;Add&lt;span class="Operator"&gt;(&lt;/span&gt;f&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//save&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;view&lt;span class="Operator"&gt;.&lt;/span&gt;Update&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;list&lt;span class="Operator"&gt;.&lt;/span&gt;Update&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;web&lt;span class="Operator"&gt;.&lt;/span&gt;Update&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;catch&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;Exception&lt;/span&gt; ex&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//log and throw&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;EventLog&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;WriteEntry&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Request Workflow Feature Receiver - Activated&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; ex&lt;span class="Operator"&gt;.&lt;/span&gt;ToString&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="ClassName"&gt;EventLogEntryType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;Error&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;throw&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td class="CodeCellMiddleSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellBottomLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p class="Text"&gt;I know that&amp;#39;s a long method and there&amp;#39;s a lot going on, so let&amp;#39;s look at some of the important lines in the above listing. The rest are examples of how I like to customize my sites via code executed in feature receivers, instead of mammoth XML site definition files. &lt;/p&gt;
&lt;p class="Text"&gt;
&lt;ul class="Text"&gt;
&lt;li class="Text"&gt;Line &lt;span class="Bold"&gt;#28&lt;/span&gt; creates the task list for the workflow, and stores a reference to it.&lt;/li&gt;
&lt;li class="Text"&gt;Lines &lt;span class="Bold"&gt;#31&lt;/span&gt; and &lt;span class="Bold"&gt;#32&lt;/span&gt; are the meat and potatoes for programmatically creating a workflow.&lt;/li&gt;
&lt;li class="Text"&gt;Lines &lt;span class="Bold"&gt;#34&lt;/span&gt; - &lt;span class="Bold"&gt;#39&lt;/span&gt; configure the workflow. Notice that some of the properties of the association can be set &amp;quot;normally&amp;quot; while others are set via (shitty) string manipulation of the association metadata. This is the first taste of how we will be setting a dynamic approver. The association metadata should be manipulated when you want to customize default settings &lt;span class="Bold"&gt;per instance&lt;/span&gt; of a workflow; the Boolean properties are for the workflow&amp;#39;s behavior as a whole.&lt;/li&gt;
&lt;li class="Text"&gt;Lines &lt;span class="Bold"&gt;#42&lt;/span&gt; and &lt;span class="Bold"&gt;#43&lt;/span&gt; implement the wiring of the event receivers for the actual request list, as well as the workflow task list. Notice in Line &lt;span class="Bold"&gt;#35&lt;/span&gt; we are not auto-starting any workflow instances, because this does not give us the opportunity to customize our initialization data. Instead, we use an event receiver on the list to read in the list data and programmatically kick off a workflow. In Line &lt;span class="Bold"&gt;#43&lt;/span&gt; , I hook the same ItemAdded event on the workflow task list, so, pending the outcome, I can react to approvals or rejections.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p class="Text"&gt;Next, let&amp;#39;s look at the code that kicks off the workflow: &lt;/p&gt;
&lt;p class="Text"&gt;
&lt;table cellpadding="0" cellspacing="0" class="CodeLayout"&gt;
&lt;tbody&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellTopLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellMiddleLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellMiddleLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleMiddle"&gt;
&lt;div class="CodeContainer"&gt;
&lt;div class="CodeLayout"&gt;&lt;ol class="Code"&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;public&lt;/span&gt; &lt;span class="Keyword"&gt;override&lt;/span&gt; &lt;span class="Keyword"&gt;void&lt;/span&gt; ItemAdded&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPItemEventProperties&lt;/span&gt; properties&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//impersonation&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPSecurity&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;RunWithElevatedPrivileges&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt; &lt;span class="Operator"&gt;=&lt;/span&gt;&lt;span class="Operator"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//initialization&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;base&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;ItemAdded&lt;span class="Operator"&gt;(&lt;/span&gt;properties&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//open site&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;using&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPSite&lt;/span&gt; site &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;new&lt;/span&gt; &lt;span class="ClassName"&gt;SPSite&lt;/span&gt;&lt;span class="Operator"&gt;(&lt;/span&gt;properties&lt;span class="Operator"&gt;.&lt;/span&gt;SiteId&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//open web&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;site&lt;span class="Operator"&gt;.&lt;/span&gt;AllowUnsafeUpdates &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;true&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;using&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPWeb&lt;/span&gt; web &lt;span class="Operator"&gt;=&lt;/span&gt; site&lt;span class="Operator"&gt;.&lt;/span&gt;RootWeb&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//get list&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPListItem&lt;/span&gt; item &lt;span class="Operator"&gt;=&lt;/span&gt; properties&lt;span class="Operator"&gt;.&lt;/span&gt;ListItem&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPList&lt;/span&gt; list &lt;span class="Operator"&gt;=&lt;/span&gt; web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;[&lt;/span&gt;properties&lt;span class="Operator"&gt;.&lt;/span&gt;ListId&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPWorkflowAssociation&lt;/span&gt; wfAssociation &lt;span class="Operator"&gt;=&lt;/span&gt; list&lt;span class="Operator"&gt;.&lt;/span&gt;WorkflowAssociations&lt;span class="Operator"&gt;[&lt;/span&gt;0&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//set approver&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPUser&lt;/span&gt; user &lt;span class="Operator"&gt;=&lt;/span&gt; properties&lt;span class="Operator"&gt;.&lt;/span&gt;ListItem&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Approver&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt; &lt;span class="Keyword"&gt;as&lt;/span&gt; &lt;span class="ClassName"&gt;SPUser&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;string&lt;/span&gt; data &lt;span class="Operator"&gt;=&lt;/span&gt; wfAssociation&lt;span class="Operator"&gt;.&lt;/span&gt;AssociationData&lt;span class="Operator"&gt;.&lt;/span&gt;Replace&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;&amp;lt;my:Reviewers&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Keyword"&gt;string&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;Format&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;&amp;lt;my:Reviewers&amp;gt;&amp;lt;my:Person&amp;gt;&amp;lt;my:DisplayName&amp;gt;{0}&amp;lt;/my:DisplayName&amp;gt;&amp;lt;my:AccountId&amp;gt;{1}&amp;lt;/my:AccountId&amp;gt;&amp;lt;my:AccountType&amp;gt;User&amp;lt;/my:AccountType&amp;gt;&amp;lt;/my:Person&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; user&lt;span class="Operator"&gt;.&lt;/span&gt;Name&lt;span class="Operator"&gt;,&lt;/span&gt; user&lt;span class="Operator"&gt;.&lt;/span&gt;LoginName&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//set description&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;data &lt;span class="Operator"&gt;=&lt;/span&gt; data&lt;span class="Operator"&gt;.&lt;/span&gt;Replace&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;&amp;lt;my:Description&amp;gt;&amp;lt;/my:Description&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="Keyword"&gt;string&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;Format&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;&amp;lt;my:Description&amp;gt;{0}&amp;lt;/my:Description&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; item&lt;span class="Operator"&gt;.&lt;/span&gt;Title&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//start workflow&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;site&lt;span class="Operator"&gt;.&lt;/span&gt;WorkflowManager&lt;span class="Operator"&gt;.&lt;/span&gt;StartWorkflow&lt;span class="Operator"&gt;(&lt;/span&gt;item&lt;span class="Operator"&gt;,&lt;/span&gt; wfAssociation&lt;span class="Operator"&gt;,&lt;/span&gt; data&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;catch&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;Exception&lt;/span&gt; ex&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//log error&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;EventLog&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;WriteEntry&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Request Workflow List Event Receiver - Item Added&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; ex&lt;span class="Operator"&gt;.&lt;/span&gt;ToString&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="ClassName"&gt;EventLogEntryType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;Error&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td class="CodeCellMiddleSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellBottomLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p class="Text"&gt;Everything boils down to Line &lt;span class="Bold"&gt;#27&lt;/span&gt; that invokes the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms435535.aspx" class="Link"&gt;StartWorkflow&lt;/a&gt; method on the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.workflowmanager.aspx" class="Link"&gt;WorkflowManager&lt;/a&gt; class, which hangs off of an &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.aspx" class="Link"&gt;SPSite&lt;/a&gt; object. This method takes in three parameters: &lt;/p&gt;
&lt;p class="Text"&gt;
&lt;ul class="Text"&gt;
&lt;li class="Text"&gt;The &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.aspx" class="Link"&gt;SPListItem&lt;/a&gt; on which the workflow operates.&lt;/li&gt;
&lt;li class="Text"&gt;The &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflowassociation.aspx" class="Link"&gt;SPWorkflowAssociation&lt;/a&gt; , which associates a workflow with a list.&lt;/li&gt;
&lt;li class="Text"&gt;A string representing the initialization data for this instance. In the Visual Studio Intellisense, the name of this parameter is &amp;quot;eventData&amp;quot; which is very misleading. Why isn&amp;#39;t it named something more intuitive to imply that it represents the initialization data for this instance? Something like, say, &amp;quot;initializationData?&amp;quot; &lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p class="Text"&gt;It is this third parameter that inspired this post. Where the hell does the initialization data come from? If you Bing around, you&amp;#39;ll see that the idea is to pass in XML (most desirably a serialized object) to define the metadata of the instance of the workflow. Now this probably isn&amp;#39;t a big deal for a custom built workflow, but how do you anticipate what the initialization data will be for an OOTB workflow? &lt;/p&gt;
&lt;p class="Text"&gt;Turns out, it&amp;#39;s the same XML as the association data! This can easily be inspected in debug mode by checking out the value of the &amp;quot;association&amp;quot; variable in the first listing above, after Line &lt;span class="Bold"&gt;#33&lt;/span&gt;. Then, down to the second listing, all I do to set an approver is grab the SPUser object from the list item data in Line &lt;span class="Bold"&gt;#22&lt;/span&gt;, and use its properties to fill in the XML of the initialization data string in Line &lt;span class="Bold"&gt;#25&lt;/span&gt;. &lt;/p&gt;
&lt;p class="Text"&gt;Then simply pass your modified XML, along with the list item and the association object, to the StartWorkflow method, and you&amp;#39;re off! &lt;/p&gt;
&lt;p class="Text"&gt;The last step here is to figure out how to get code to run when the workflow instance is approved. My approach was to use another event receiver, but this time on the workflow task list itself. Hooking the ItemUpdated event and checking the task item&amp;#39;s &amp;quot;Outcome&amp;quot; column for a value that starts with &amp;quot;Approved&amp;quot; will get us there. Here&amp;#39;s the code: &lt;/p&gt;
&lt;p class="Text"&gt;
&lt;table cellpadding="0" cellspacing="0" class="CodeLayout"&gt;
&lt;tbody&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellTopLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellTopRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellMiddleLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellMiddleLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleMiddle"&gt;
&lt;div class="CodeContainer"&gt;
&lt;div class="CodeLayout"&gt;&lt;ol class="Code"&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;public&lt;/span&gt; &lt;span class="Keyword"&gt;override&lt;/span&gt; &lt;span class="Keyword"&gt;void&lt;/span&gt; ItemUpdated&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPItemEventProperties&lt;/span&gt; properties&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//impersonation&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPSecurity&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;RunWithElevatedPrivileges&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt; &lt;span class="Operator"&gt;=&lt;/span&gt;&lt;span class="Operator"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//initialization&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;base&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;ItemUpdated&lt;span class="Operator"&gt;(&lt;/span&gt;properties&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//open site&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;using&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPSite&lt;/span&gt; site &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;new&lt;/span&gt; &lt;span class="ClassName"&gt;SPSite&lt;/span&gt;&lt;span class="Operator"&gt;(&lt;/span&gt;properties&lt;span class="Operator"&gt;.&lt;/span&gt;SiteId&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//open web&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;site&lt;span class="Operator"&gt;.&lt;/span&gt;AllowUnsafeUpdates &lt;span class="Operator"&gt;=&lt;/span&gt; &lt;span class="Keyword"&gt;true&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;using&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;SPWeb&lt;/span&gt; web &lt;span class="Operator"&gt;=&lt;/span&gt; site&lt;span class="Operator"&gt;.&lt;/span&gt;RootWeb&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//get the workflow item&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPListItem&lt;/span&gt; item &lt;span class="Operator"&gt;=&lt;/span&gt; properties&lt;span class="Operator"&gt;.&lt;/span&gt;ListItem&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPList&lt;/span&gt; list &lt;span class="Operator"&gt;=&lt;/span&gt; web&lt;span class="Operator"&gt;.&lt;/span&gt;Lists&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Keyword"&gt;new&lt;/span&gt; &lt;span class="ClassName"&gt;Guid&lt;/span&gt;&lt;span class="Operator"&gt;(&lt;/span&gt;item&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;WorkflowListId&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;ToString&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;SPListItem&lt;/span&gt; wfItem &lt;span class="Operator"&gt;=&lt;/span&gt; list&lt;span class="Operator"&gt;.&lt;/span&gt;GetItemById&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;Convert&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;ToInt32&lt;span class="Operator"&gt;(&lt;/span&gt;item&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;WorkflowItemId&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;ToString&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//make sure the item was approved&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;if&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;item&lt;span class="Operator"&gt;[&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Outcome&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;]&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;ToString&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;StartsWith&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Approved&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:60px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//do stuff here&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:50px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:40px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Keyword"&gt;catch&lt;/span&gt; &lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="ClassName"&gt;Exception&lt;/span&gt; ex&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="Comment"&gt;//log error&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:30px;"&gt;&lt;span class="Code"&gt;&lt;span class="ClassName"&gt;EventLog&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;WriteEntry&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Constant"&gt;&amp;quot;Request Workflow Task List Event Receiver - Item Updated&amp;quot;&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; ex&lt;span class="Operator"&gt;.&lt;/span&gt;ToString&lt;span class="Operator"&gt;(&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;,&lt;/span&gt; &lt;span class="ClassName"&gt;EventLogEntryType&lt;/span&gt;&lt;span class="Operator"&gt;.&lt;/span&gt;Error&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:20px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:10px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;span class="Operator"&gt;)&lt;/span&gt;&lt;span class="Operator"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="Code" style="padding-left:0px;"&gt;&lt;span class="Code"&gt;&lt;span class="Operator"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td class="CodeCellMiddleSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellMiddleRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="CodeRow"&gt;
&lt;td class="CodeCellBottomLeft"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomMiddle"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomSpacer"&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class="CodeCellBottomRight"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p class="Text"&gt;
&lt;ul class="Text"&gt;
&lt;li class="Text"&gt;Lines &lt;span class="Bold"&gt;#19&lt;/span&gt; and &lt;span class="Bold"&gt;#20&lt;/span&gt; give us a reference to the list item that the workflow instance just approved (verses the task list item in the workflow task list).&lt;/li&gt;
&lt;li class="Text"&gt;Line &lt;span class="Bold"&gt;#22&lt;/span&gt; is, of course, a bit of a kludge, but safe for the Approval workflow. Don&amp;#39;t use the &amp;quot;Status&amp;quot; column, as that is the status of the task itself, not the workflow. Hence the kludge.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p class="Text"&gt;That&amp;#39;s it! As you can see, you can push OOTB workflows pretty far beyond the customizations available on the association page during configuration. But don&amp;#39;t go too nuts extending these workflows; depending on your requirements, it might just take less time to build it from scratch! &lt;/p&gt;
&lt;p class="Text"&gt;Have fun! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.rightpoint.com/community/aggbug.aspx?PostID=2758" width="1" height="1"&gt;</description><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/Workflow/default.aspx">Workflow</category><category domain="http://www.rightpoint.com/community/blogs/viewpoint/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category></item></channel></rss>