<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-576987677725957956</id><updated>2011-07-08T04:31:39.784-07:00</updated><title type='text'>Share my Point of View</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bastiaan-kortenbout.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576987677725957956/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bastiaan-kortenbout.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bastiaan Kortenbout</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_RaZSmpTbBg8/SuWqmhblIhI/AAAAAAAAAE8/2C2pIP0FRDU/S220/CIMG5428.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-576987677725957956.post-5270033982431913141</id><published>2009-11-10T08:12:00.001-08:00</published><updated>2009-11-11T02:20:17.854-08:00</updated><title type='text'>Add description to SharePoint survey questions</title><content type='html'>Whoot. This is cool. &lt;br /&gt;&lt;br /&gt;Together with my customer, we decided to use the SharePoint survey in our intranet environment. Although, there was one functionality missing out-of-the-box: providing a description with every question. This function usually is supported in SharePoint, but unfortunately it is not implemented by default. I asked myself the question, what do I need to do to accomplish this? &lt;br /&gt;&lt;br /&gt;1. Create a place in the object model to save the Description; &lt;br /&gt;2. Edit the qstedit.aspx &amp; qstnew.aspx to provide the Description; &lt;br /&gt;3. Edit the SurveyForm template so my description would show up. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Part 1&lt;/strong&gt; &lt;br /&gt;While testing part 1 of my solution, I created a feature that added an extra field to the SurveyList.Fields. I accomplished this by using the SPList.Fields.AddFieldAsXml() method. An unpleasant and unexpected surprise: this didn't result in an extra property per question, but an extra question named Description itself! That made me curious about how SharePoint saves the survey data, so I opened my &lt;a href="http://www.codeplex.com/spm"&gt;SharePoint Manager&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_RaZSmpTbBg8/SvmWpu8qowI/AAAAAAAAAFg/jvHLsdkPQhY/s1600-h/spm.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 316px; height: 320px;" src="http://4.bp.blogspot.com/_RaZSmpTbBg8/SvmWpu8qowI/AAAAAAAAAFg/jvHLsdkPQhY/s320/spm.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5402514871728907010" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;As you can see in the picture above, there is already a property to save a Description! This is gonna be easy! &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Part 2&lt;/strong&gt; &lt;br /&gt;The form to create a new response to a survey is located at: ~/layouts/qstnew.aspx. Inside this page you'll find alot of Javascript and some HTML. You just have to add the following HTML (@ line 1263) to provide a textarea where the description can be provided: &lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt;&amp;lt;!-- description --&amp;gt; &lt;br /&gt;&amp;lt;tr&amp;gt; &lt;br /&gt;&amp;lt;td class=&amp;quot;ms-authoringcontrols&amp;quot; width=10&amp;gt;&amp;amp;nbsp;&amp;lt;/TD&amp;gt; &lt;br /&gt;&amp;lt;td class=&amp;quot;ms-authoringcontrols&amp;quot; ID=TD1&amp;gt;&amp;lt;label for=&amp;quot;idColName&amp;quot;&amp;gt;Description:&amp;lt;/LABEL&amp;gt;&amp;lt;font size=3&amp;gt;&amp;amp;nbsp;&amp;lt;/FONT&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;table border=0 cellspacing=1&amp;gt;&amp;lt;tr&amp;gt; &amp;lt;td colspan=2&amp;gt; &lt;br /&gt;&amp;lt;textarea class=&amp;quot;ms-long&amp;quot; cols=40 rows=5 name=&amp;quot;Description&amp;quot; id=&amp;quot;Description&amp;quot; size=30&amp;gt;&amp;lt;%SPHttpUtility.HtmlEncode(strDescription,Response.Output);%&amp;gt;&amp;lt;/TEXTAREA&amp;gt; &lt;br /&gt;&amp;lt;/TD&amp;gt; &amp;lt;/TR&amp;gt;&amp;lt;/TABLE&amp;gt;&amp;lt;/TD&amp;gt; &lt;br /&gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- end description --&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Also edit the qstedit.aspx in the virtual layouts folder. This seems to be my lucky day, because the Javascript to include the current Description from the object model in the textbox area is already there! You only have to add the following code @ line 1661. &lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt;&amp;lt;!-- description --&amp;gt; &lt;br /&gt;&amp;lt;tr&amp;gt; &lt;br /&gt;&amp;lt;td class=&amp;quot;ms-authoringcontrols&amp;quot; width=10&amp;gt;&amp;amp;nbsp;&amp;lt;/TD&amp;gt; &lt;br /&gt;&amp;lt;td class=&amp;quot;ms-authoringcontrols&amp;quot; ID=onetidFldEditGuts2&amp;gt;&amp;lt;label for=&amp;quot;idColName&amp;quot;&amp;gt;Description:&amp;lt;/LABEL&amp;gt;&amp;lt;font size=3&amp;gt;&amp;amp;nbsp;&amp;lt;/FONT&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;table border=0 cellspacing=1&amp;gt;&amp;lt;tr&amp;gt; &amp;lt;td colspan=2&amp;gt; &lt;br /&gt;&amp;lt;textarea class=&amp;quot;ms-long&amp;quot; cols=40 rows=5 name=&amp;quot;Description&amp;quot; id=&amp;quot;Description&amp;quot; size=30&amp;gt;&amp;lt;%SPHttpUtility.HtmlEncode(strDescription,Response.Output);%&amp;gt;&amp;lt;/TEXTAREA&amp;gt; &lt;br /&gt;&amp;lt;/TD&amp;gt; &amp;lt;/TR&amp;gt;&amp;lt;/TABLE&amp;gt;&amp;lt;/TD&amp;gt; &lt;br /&gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;&amp;lt;!-- end description --&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Your form will look something like this: &lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_RaZSmpTbBg8/Svmc2-LL-nI/AAAAAAAAAFo/lfR1nlqg5q0/s1600-h/survey.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 232px;" src="http://2.bp.blogspot.com/_RaZSmpTbBg8/Svmc2-LL-nI/AAAAAAAAAFo/lfR1nlqg5q0/s320/survey.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5402521696224410226" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Part 3&lt;/strong&gt; &lt;br /&gt;At this point we can save a Description per question. I assumed the functionality to present the Description in the SurveyForm template wasn't build by Microsoft, because there was no possibility to provide a description. At this point, I was afraid that I had to rewrite the SurveyForm template, including Branching Logic. A pleasant and unexpected surprise: the description was already presented! The description is shown nicely on the form when a user is creating a response for a survey, as you can see below: &lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_RaZSmpTbBg8/SvmdsMPoeNI/AAAAAAAAAFw/vre_GcPJWjI/s1600-h/survey2.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 232px;" src="http://4.bp.blogspot.com/_RaZSmpTbBg8/SvmdsMPoeNI/AAAAAAAAAFw/vre_GcPJWjI/s320/survey2.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5402522610534217938" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Summarized&lt;/strong&gt; &lt;br /&gt;To provide a description with your survey questions, just alter the qstnew.aspx and qstedit.aspx pages in the layouts folder! SharePoint will do the rest for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576987677725957956-5270033982431913141?l=bastiaan-kortenbout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bastiaan-kortenbout.blogspot.com/feeds/5270033982431913141/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bastiaan-kortenbout.blogspot.com/2009/11/add-description-to-sharepoint-survey.html#comment-form' title='1 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576987677725957956/posts/default/5270033982431913141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576987677725957956/posts/default/5270033982431913141'/><link rel='alternate' type='text/html' href='http://bastiaan-kortenbout.blogspot.com/2009/11/add-description-to-sharepoint-survey.html' title='Add description to SharePoint survey questions'/><author><name>Bastiaan Kortenbout</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_RaZSmpTbBg8/SuWqmhblIhI/AAAAAAAAAE8/2C2pIP0FRDU/S220/CIMG5428.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_RaZSmpTbBg8/SvmWpu8qowI/AAAAAAAAAFg/jvHLsdkPQhY/s72-c/spm.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-576987677725957956.post-5553876889160474999</id><published>2009-11-09T06:34:00.000-08:00</published><updated>2009-11-11T02:40:00.487-08:00</updated><title type='text'>Preset form values in SharePoint 2007</title><content type='html'>My current customer is implementing a new system that is currently using a Windows help file (.hlp) to provide help/workinstructions for a specific form or field in that application. In the current situation, a user is presented with a static help article when F1 is pressed. Because it's difficult to maintain this help file, we decided to migrate these help/workinstructions to a Microsoft SharePoint Wiki library. Together with an approval workflow, it's easier to maintain the content of the help library.&lt;br /&gt;&lt;br /&gt;In the new situation, a browser instance is started when a user presses F1, referring to the SharePoint portal. The ID's related to the window or field where the user pressed the F1 key are provided through parameters in the URL. A custom webpart fetches the querystring parameters from the URL and checks with a CAML query if there are any matching Wiki articles. When a single article is found, the user is redirect to the matching article. When there are no articles found, the user is provided with a link to create a new article. The default newform page doesn’t have the ability to preset any values. Because I cannot explain to an end-user to manually enter the metadata properties for the new article, those values need to be filled in automatically according to the parameters in the URL.&lt;br /&gt;&lt;br /&gt;I accomplished this using a brilliant javascript provided by Rob Howard, a Microsoft developer with a &lt;a href="http://blogs.msdn.com/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx"&gt;blog&lt;/a&gt;. There are some interesting comments underneath his blogpost.&lt;br /&gt;&lt;br /&gt;CodePlex offers a solution that makes it easy to include javascript or jQuery in your SharePoint list forms, using a custom field. Unfortunately, this only works when the form pages are located in the forms folder of the SharePoint list. The form used by a Wiki to create a new article is located in the layouts folder (~/_layouts/CreateWebPage.aspx). Using ASPX forms outside the form folder of the list is not supported by this solution. In case you want to do the same for a document library or custom list, you can use &lt;a href="http://spjqueryfield.codeplex.com"&gt;this&lt;/a&gt; pragmatic solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/576987677725957956-5553876889160474999?l=bastiaan-kortenbout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bastiaan-kortenbout.blogspot.com/feeds/5553876889160474999/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bastiaan-kortenbout.blogspot.com/2009/11/preset-form-values-in-sharepoint-2007.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/576987677725957956/posts/default/5553876889160474999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/576987677725957956/posts/default/5553876889160474999'/><link rel='alternate' type='text/html' href='http://bastiaan-kortenbout.blogspot.com/2009/11/preset-form-values-in-sharepoint-2007.html' title='Preset form values in SharePoint 2007'/><author><name>Bastiaan Kortenbout</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_RaZSmpTbBg8/SuWqmhblIhI/AAAAAAAAAE8/2C2pIP0FRDU/S220/CIMG5428.JPG'/></author><thr:total>0</thr:total></entry></feed>
