<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">SharePoint Skater</title><subtitle type="html">Custom control and client script aficionado, neck-deep in a simmering SharePoint stew.</subtitle><id>http://weblogs.asp.net/peterbrunone/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/peterbrunone/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2010-10-05T12:19:00Z</updated><entry><title>Hiding buttons on the SharePoint ECB with JavaScript</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2012/05/10/hiding-buttons-on-the-ecb.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2012/05/10/hiding-buttons-on-the-ecb.aspx</id><published>2012-05-10T20:34:00Z</published><updated>2012-05-10T20:34:00Z</updated><content type="html">&lt;p&gt;Some of my best discoveries come from forum questions.  Not that I'm the first one to discover it, mind you -- I'm well aware that my wheel has probably been invented countless times -- but my mind grows best when I have to research a solution for someone else's problem (maybe that's why I like consulting).
&lt;/p&gt;

&lt;p&gt;Today's question was a simple one:  how do I remove the Edit Item and Workflows buttons from the ECB (Edit Control Block) in a particular list view?
If you're not familiar with the ECB for a list item, go to a list and select any list item; the List Item ECB will appear in the ribbon with commands like New Item, New Folder, etc.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Since a list view is just an aspx file, we can add some client-side code -- either directly in the page, or by way of the Content Editor Web Part.
Our code depends on jQuery, and looks like this:
&lt;/p&gt;

&lt;pre style="font-family: lucida console, courier new; font-size: 12px;"&gt;$("td").hover(function() {
	hideEditAndWorkflows();
});
$("input").hover(function() {
	hideEditAndWorkflows();
});
function hideEditAndWorkflows() {
	$("#Ribbon\\.ListItem\\.Workflow").css("display", "none");
	$("#Ribbon\\.ListItem\\.Manage\\.EditProperties-Large").remove();
	}
&lt;/pre&gt;
&lt;p&gt;
If you're&amp;nbsp;a jQuery novice, you'll want to visit jQuery.com and get the latest version --&amp;nbsp;simply upload the necessary JS file to a library and add a script link to it in the page (there's a ton of reference material out there, including the excellent documentation at the jQuery site).&lt;/p&gt;&lt;p&gt;You may wonder at the&amp;nbsp;backslashes&amp;nbsp;we're using in the hideEditAndWorkflows function.&amp;nbsp; Since these element IDs contain special characters (normally the dot denotes a class in CSS selectors), we have to escape them so that we can pass them properly through the system.&lt;/p&gt;&lt;p&gt;Once you have this code in place, you'll see the Edit and Workflows buttons for a moment after clicking the first list item on the page; after that, they should disappear and be completely unavailable to your average user.&lt;/p&gt;&lt;p&gt;Of course, client-side techniques like this will only go so far; if someone is technically adept and has the ability to perform these operations, he or she can open up the developer console and find the missing pieces.&amp;nbsp; Be aware of this whenever you manipulate the SharePoint UI with JavaScript; while it's fun and easy, this technique should never be a substitute for proper governance.&lt;/p&gt;&lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8462962" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="JavaScript" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/JavaScript/default.aspx" /><category term="jQuery" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/jQuery/default.aspx" /></entry><entry><title>Error when creating a site from a custom template:  "A duplicate name 'FieldName' was found"</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2012/05/08/error-when-creating-a-site-from-a-custom-template-quot-a-duplicate-name-fieldname-was-found-quot.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2012/05/08/error-when-creating-a-site-from-a-custom-template-quot-a-duplicate-name-fieldname-was-found-quot.aspx</id><published>2012-05-08T21:01:00Z</published><updated>2012-05-08T21:01:00Z</updated><content type="html">This happened to me in a client's WSS3 environment, but it seems to apply to 2010 as well.  I had a site template created in one environment, but upon moving it to another, the Create Site operation resulted in a neat little error, complete with stack trace:  "A duplicate name 'YourField' was found".

Upon investigating, I found that one of the lists in the newly-created site did indeed have duplicate fields.  What was odd in this case was that the the list was based on a content type, and only one of the duplicates came from said content type.  I deleted the extra fields, re-saved the template in the new environment, and created again -- only to have similar results.

Several forum posts recommend cutting open the template on your local machine, editing the XML, and rebuilding the solution CAB, but in my case, all it took was a quick "Delete list" followed by re-creating it and re-adding the content type.  Save as template again, and this time -- instant site creation satisfaction.&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8453641" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="Content Types" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Content+Types/default.aspx" /><category term="sharepoint error" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/sharepoint+error/default.aspx" /></entry><entry><title>SharePoint Saturday Houston:  9 days and counting</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2012/04/18/sharepoint-saturday-houston-9-days-and-counting.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2012/04/18/sharepoint-saturday-houston-9-days-and-counting.aspx</id><published>2012-04-18T19:05:00Z</published><updated>2012-04-18T19:05:00Z</updated><content type="html">&lt;p&gt;In just over a week, I'll be speaking at &lt;a href="http://sharepointsaturday.org/houston/default.aspx" mce_href="http://sharepointsaturday.org/houston/default.aspx"&gt;SharePoint Saturday Houston&lt;/a&gt;. My topic will be Manipulating SharePoint with Client-Side JavaScript; we'll address client-side coding as a whole, look at the Client-Side Object Model, and then dive into a working sample app using the CSOM and jQuery.&amp;nbsp; Come see how easy it is to develop complex solutions for SharePoint 2010 without ever opening Visual Studio.&lt;/p&gt;&lt;p&gt;The event is already chock-full of high-profile speakers and generous sponsors (and a few guys like me, with a session right after the huge gourmet lunch) -- and with just over 100 seats left, you'll want to register right away.&amp;nbsp; Hope to see you there!&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8395902" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/General+Software+Development/default.aspx" /><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>SharePoint Client Object Model: Step One</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2012/04/10/sharepoint-client-object-model-step-one.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2012/04/10/sharepoint-client-object-model-step-one.aspx</id><published>2012-04-10T19:12:00Z</published><updated>2012-04-10T19:12:00Z</updated><content type="html">&lt;p&gt;I almost didn't make it out alive.&amp;nbsp; I followed the instructions in every piece of sample code and every forum post by someone who had no idea why their client OM code wasn't working, and my code still wouldn't get past the page load.&amp;nbsp; I kept getting "'Type' is undefined" errors when sp.core.js tried to register the SP namespace.&lt;br&gt;&lt;/p&gt;&lt;p&gt;As it turns out, you need the help of the default master page (or one like it) to get the object model loaded.&amp;nbsp; Once I told my sample page to use the default master and modified everything accordingly, it hooked up and ran just fine.&lt;/p&gt;&lt;p&gt;Now I can finally get some work done. &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8384017" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/General+Software+Development/default.aspx" /><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>Agility in SharePoint:  Writing Functional Requirements</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2012/02/03/writing-requirements.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2012/02/03/writing-requirements.aspx</id><published>2012-02-03T16:52:00Z</published><updated>2012-02-03T16:52:00Z</updated><content type="html">&lt;p&gt;SharePoint brings more power than ever to the end user.&amp;nbsp; As usual, this is a double-edged sword.&amp;nbsp; Its utility as a development platform is unmatched, but since many of the development tools are accessible from the browser UI, the dividing lines can get blurred.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Requirements-gathering (and subsequent documentation) can be tricky, and it's easy for us technical types to get confused about functional versus technical.&amp;nbsp; Business users do not care about technical requirements and they should not have the opportunity to dictate them.&amp;nbsp; If you have to explain a term (for example, "list" or "metadata column") to an end user, then most likely it does not belong under the heading of "functional requirements".&lt;/p&gt;&lt;p&gt;Functional requirements are about what the end user needs to accomplish.&amp;nbsp; An excellent guide for this is the concept of the User Story, as employed in Agile 
project management (we're kind of big on that here at Improving).&amp;nbsp; The basic format is as follows:&lt;br&gt;
&lt;br&gt;As a _______ (what type of user), &lt;br&gt;&lt;br&gt;I want _________&lt;br&gt;&lt;br&gt;so that I can ___________&lt;br&gt;&lt;br&gt;This
 kind of requirement requires (heh) that you also define acceptance 
criteria, by which you can determine that the
 requirement has been fulfilled. The end result is that nobody can claim confusion about what you're trying to do, since the team has already agreed on the definition of "done".&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8279589" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/General+Software+Development/default.aspx" /><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="agile" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/agile/default.aspx" /></entry><entry><title>Non-technical hiatus:  Movember</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2011/11/29/non-technical-hiatus-movember.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2011/11/29/non-technical-hiatus-movember.aspx</id><published>2011-11-29T16:20:00Z</published><updated>2011-11-29T16:20:00Z</updated><content type="html">&lt;p&gt;Here at &lt;a href="http://improvingenterprises.com" mce_href="http://improvingenterprises.com"&gt;Improving Enterprises&lt;/a&gt;, we have a relatively new annual tradition of forming a moustache team for Movember.&amp;nbsp; For those who are new to the concept, Movember is a month-long fundraising effort for men's cancer research.&amp;nbsp; Each year, men (Mo Bros) from around the world join in sprouting a symbol of solidarity -- with the goal of eradicating men's cancers.&lt;/p&gt;&lt;p&gt;If you're able, &lt;a href="http://mobro.co/PeterBrunone" title="Peter Brunone's Mo Site" mce_href="http://mobro.co/PeterBrunone"&gt;please consider donating&lt;/a&gt; to this vital effort.&amp;nbsp; You can read up on where the money goes and how it is spent, you can learn about the history of Movember, and of course you can see goofy pictures of me with incomplete facial hair (if you're into that sort of thing).&lt;/p&gt;&lt;p&gt;Thank you for your time, your money, or merely your attention.&amp;nbsp; To show my gratitude, here's what the genetic recombination of Burt Reynolds and Derek Zoolander would look like if he had some sort of mental problem. &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="http://static.movember.com/uploads/2011/profiles/fb4/792/fb479244b45949c300e9d1721ab17869-4ed5055639f51-hero.jpg" title="My 'stachitude." alt="My 'stachitude." mce_src="http://static.movember.com/uploads/2011/profiles/fb4/792/fb479244b45949c300e9d1721ab17869-4ed5055639f51-hero.jpg" align="top" height="400"&gt; &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8080872" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author></entry><entry><title>"The requested operation requires elevation"</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2011/07/13/quot-the-requested-operation-requires-elevation-quot.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2011/07/13/quot-the-requested-operation-requires-elevation-quot.aspx</id><published>2011-07-13T21:20:00Z</published><updated>2011-07-13T21:20:00Z</updated><content type="html">&lt;p&gt;Typical SharePoint 2010 install.&amp;nbsp; I had created all my domain users, set up my servers, and started installing the prerequisites.&amp;nbsp; When the first box in the farm restarted and the preparation utility came up, I was asked for credentials and provided them, only to be rejected.&amp;nbsp; At first I thought it was a standard "access denied" error, but a look at the fine print revealed the error titling this post.&lt;/p&gt;&lt;p&gt;I tried Run As Administrator; still no success.&lt;/p&gt;&lt;p&gt;Eventually I realized that I was signed in as the farm account, though I had not yet made it a local administrator.&amp;nbsp; I right-clicked Computer Management, ran THAT with the proper credentials, made the farm account local admin, and all was right with the world.&lt;/p&gt;&lt;p&gt;Sometimes it's the little things. &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7868778" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="sharepoint installation" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/sharepoint+installation/default.aspx" /><category term="sharepoint configuration" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/sharepoint+configuration/default.aspx" /></entry><entry><title>"The data source control failed to execute the insert (or update) command", or How to Make Your Workday a Bit Shorter</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2011/05/27/quot-the-data-source-control-failed-to-execute-the-insert-or-update-command-quot-or-how-to-make-your-workday-a-bit-shorter.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2011/05/27/quot-the-data-source-control-failed-to-execute-the-insert-or-update-command-quot-or-how-to-make-your-workday-a-bit-shorter.aspx</id><published>2011-05-27T16:08:00Z</published><updated>2011-05-27T16:08:00Z</updated><content type="html">&lt;p&gt;Custom list.&amp;nbsp; Custom New/Edit/View forms.&amp;nbsp; Everything works perfectly... until the latest round of updates.&lt;/p&gt;&lt;p&gt;Now if you Bingle this error message, you'll get about twenty possible causes that run the gamut from a known bug, an unknown bug, and fixed/not fixed/hotfixed/workaround bug, all the way to corrupt content types and invalid form data.&lt;/p&gt;&lt;p&gt;In my case, however, it turned out to be a misspelled column name in a FormField control.&lt;/p&gt;&lt;p&gt;I'm just glad it's Friday. &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7806016" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="SharePoint Designer" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Designer/default.aspx" /><category term="SharePoint Customization" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Customization/default.aspx" /><category term="sharepoint error" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/sharepoint+error/default.aspx" /></entry><entry><title>Removing the 12:00 timestamp from Calendar View</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2011/05/04/removing-the-12-00-timestamp-from-calendar-view.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2011/05/04/removing-the-12-00-timestamp-from-calendar-view.aspx</id><published>2011-05-04T21:33:00Z</published><updated>2011-05-04T21:33:00Z</updated><content type="html">

&lt;p&gt;Occasionally, you have a calendar full of all-day events and you don't want the calendar cluttered up with redundant timestamps.&amp;nbsp; Here's a simple client-side script, suitable for framing (or a master page, or a content editor web part) that will cut down on the visual noise. &lt;br&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;script language="JavaScript"&amp;gt;
var allDates = document.getElementsByTagName("nobr");
for(var i=0;i&lt;alldates.length;i++) {="" if(alldates[i].innerhtml.indexof(="" 12:00="" )=""&gt; 0) {
      allDates[i].innerHTML = allDates[i].innerHTML.replace("12:00 AM","");
    }
  }
&amp;lt;/script&amp;gt;
&lt;/alldates.length;i++)&gt;&lt;/pre&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7776810" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint Customization" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Customization/default.aspx" /></entry><entry><title>Nitpicking that matters: changing default forms on a SharePoint 2007 list</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2011/04/20/nitpicking-that-matters-changing-default-forms-on-a-sharepoint-2007-list.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2011/04/20/nitpicking-that-matters-changing-default-forms-on-a-sharepoint-2007-list.aspx</id><published>2011-04-20T19:34:00Z</published><updated>2011-04-20T19:34:00Z</updated><content type="html">&lt;p&gt;This is a fairly common request, but the solution is often missing one crucial point.&amp;nbsp; To use a custom New/Edit/Display form on your list, proceed as follows:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Open your site in SharePoint Designer.&lt;/li&gt;&lt;li&gt;Right-click the desired List (under the Lists node) and select &lt;b&gt;Properties&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Click the &lt;b&gt;Supporting Files&lt;/b&gt; tab.&lt;/li&gt;&lt;li&gt;Under &lt;b&gt;Content type specific forms&lt;/b&gt;, select the &lt;b&gt;Item&lt;/b&gt; content type &lt;i&gt;(this is the part most people forget)&lt;/i&gt;.&amp;nbsp; If you are using a custom content type, select that; just make sure that the &lt;b&gt;Folder&lt;/b&gt; type is NOT selected.&lt;/li&gt;&lt;li&gt;Use the &lt;b&gt;Browse&lt;/b&gt; button to select your custom forms in each category.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;OK&lt;/b&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;br&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7765891" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint Designer" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Designer/default.aspx" /><category term="SharePoint Customization" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Customization/default.aspx" /></entry><entry><title>SharePoint Designer workflow workarounds:  tracking individual column changes</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2011/03/07/workflow-workarounds-tracking-individual-column-changes.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2011/03/07/workflow-workarounds-tracking-individual-column-changes.aspx</id><published>2011-03-07T15:46:00Z</published><updated>2011-03-07T15:46:00Z</updated><content type="html">&lt;p&gt;This post is long overdue, but since the question keeps popping up on various SharePoint discussion lists, I figured I'd document the answer here (next time I can just post a link instead of typing the whole thing out again).&lt;/p&gt;&lt;p&gt;In a SPD workflow, you cannot trigger a SharePoint workflow when a column changes; you can only use the ItemChanged event.&amp;nbsp; To get more granular, then, you need to add some extra bits.&lt;/p&gt;&lt;p&gt;Let's say you have a list called "5K Races" with a column called StartTime, and you want to execute some actions when the StartTime value changes.&amp;nbsp; Simply perform the following steps:&lt;/p&gt;&lt;p&gt;1)&amp;nbsp; Create an additional column (same datatype) called OldStartTime.&lt;/p&gt;&lt;p&gt;2)&amp;nbsp; When the workflow starts, compare StartTime to OldStartTime.&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp; a) If they are equal, then do nothing (end).&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp; b) If they are NOT equal, proceed with your workflow.&lt;/p&gt;&lt;p&gt;3)&amp;nbsp; If 2b, then set OldStartTime to the value of StartTime.&lt;/p&gt;&lt;p&gt;By performing step 3, you ensure that by the end of the workflow, OldStartTime will be equal to StartTime -- this is important because the workflow will continue to run every time a particular item is changed, but by taking away the criterion that would cause the workflow to run the second time, you have avoided an endless loop situation.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7717268" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint Designer" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Designer/default.aspx" /><category term="sharepoint workflow" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/sharepoint+workflow/default.aspx" /></entry><entry><title>Read-only lock on a SharePoint site collection, or Why can't I edit anymore?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2011/03/01/read-only-lock-on-a-sharepoint-site-collection-or-why-can-t-i-edit-anymore.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2011/03/01/read-only-lock-on-a-sharepoint-site-collection-or-why-can-t-i-edit-anymore.aspx</id><published>2011-03-01T16:01:00Z</published><updated>2011-03-01T16:01:00Z</updated><content type="html">&lt;p&gt;Monday morning, the calls started.&amp;nbsp; For some reason, long-time users were unable to edit list items.&amp;nbsp; I figured we had a permissions issue, so I popped in to look at the Site Settings -- and found that I couldn't.&amp;nbsp; A quick trip to Central Administration showed that I was still listed as a Site Collection Administrator, but I had no power at all on the site collection in question.&lt;/p&gt;&lt;p&gt;A quick glance at the logs told me that the server had recently shut down unexpectedly (this is a Hyper-V virtual machine).&amp;nbsp; Apparently, in the confusion, somehow SharePoint decided to lock the site collection as Read Only.&amp;nbsp; This can be remedied in one of two ways:&lt;/p&gt;&lt;p&gt;1)&amp;nbsp; In Central Administration, go to Application Management-&amp;gt;SharePoint Site Management-&amp;gt;Site collection quotas and locks.&amp;nbsp; Once you have arrived, select the correct application and site collection, and you will have the opportunity to view and set the lock status of the collection (it most likely will be set to "Read-only", and you'll want to move that radio button to "Not locked").&lt;/p&gt;&lt;p&gt;2)&amp;nbsp; Fire up stsadm and issue the following command:&lt;/p&gt;&lt;p&gt;stsadm -o setsitelock -url http://myportalsitecollection -lock none &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7714476" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /></entry><entry><title>Phone number mask in a DataView WebPart (DVWP)</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2010/12/07/phone-number-mask-in-a-dataview-webpart-dvwp.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2010/12/07/phone-number-mask-in-a-dataview-webpart-dvwp.aspx</id><published>2010-12-07T16:34:00Z</published><updated>2010-12-07T16:34:00Z</updated><content type="html">&lt;p&gt;This came up today on the [sharepointdiscussions] list.&amp;nbsp; A user needed to display a read-only field in a phone number format; it's pretty simple, but it may be just what you need.&lt;/p&gt;&lt;p&gt;Assuming your list item contains a field called "Phone Number" (with a space), the following XPath will give you a number in the classic US telephone format: &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;xsl:value-of select="concat('(',substring(@Phone_x0020_Number,1,3),')',substring(@Phone_x0020_Number,4,3),'-',substring(@Phone_x0020_Number,7,4))" /&amp;gt; &lt;/p&gt;&lt;p&gt;If you need to mask an input, try &lt;a href="http://spdeveloper.net/tag/jquery/" mce_href="http://spdeveloper.net/tag/jquery/"&gt;this jQuery solution&lt;/a&gt;. &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7657753" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint Designer" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Designer/default.aspx" /><category term="SharePoint Customization" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Customization/default.aspx" /></entry><entry><title>Generate a Word document from list data</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2010/12/06/generate-a-word-document-from-list-data.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2010/12/06/generate-a-word-document-from-list-data.aspx</id><published>2010-12-06T16:24:00Z</published><updated>2010-12-06T16:24:00Z</updated><content type="html">
&lt;p&gt;This came up on a discussion list lately, so I threw together some code to meet the need.&amp;nbsp; In short, a colleague needed to take the results of an InfoPath form survey and give them to the user in Word format.&amp;nbsp; The form data was already in a list item, so it was a simple matter of using the SharePoint API to get the list item, formatting the data appropriately, and using response headers to make the client machine treat the response as MS Word content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The following rudimentary code can be run in an ASPX (or an assembly) in the 12 hive.&amp;nbsp; When you link to the page, send the list name and item ID in the querystring and use them to grab the appropriate data.&lt;/p&gt;
&lt;p style="font-family: courier new;"&gt;// Clear the current response headers and set them up to look like a word doc.&lt;br&gt;HttpContext.Current.Response.Clear();&lt;br&gt;HttpContext.Current.Response.Charset ="";&lt;br&gt;HttpContext.Current.Response.ContentType ="application/msword";&lt;br&gt;string strFileName = "ThatWordFileYouWanted"+ ".doc";&lt;br&gt;HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=" + strFileName);&lt;br&gt;&lt;br&gt;// Using the current site, get the List by name and then the Item by ID (from the URL).&lt;br&gt;string myListName = HttpContext.Current.Request.Querystring["listName"];&lt;br&gt;int myID = Convert.ToInt32(HttpContext.Current.Request.Querystring["itemID"]);&lt;br&gt;SPSite oSite = SPContext.Current.Site;&lt;br&gt;SPWeb oWeb = oSite.OpenWeb();&lt;br&gt;SPList oList = oWeb.Lists["MyListName"];&lt;br&gt;SPListItem oListItem = oList.Items.GetItemById(myID);&lt;br&gt;&lt;br&gt;// Build a string with the data -- format it with HTML if you like. &lt;br&gt;StringBuilder strHTMLContent = newStringBuilder();&lt;br&gt;&lt;br&gt;// *&lt;br&gt;// Here's where you pull individual fields out of the list item.&lt;br&gt;// *&lt;br&gt;&lt;br&gt;// Once everything is ready, spit it out to the client machine.&lt;br&gt;&lt;br&gt;HttpContext.Current.Response.Write(strHTMLContent);&lt;br&gt;HttpContext.Current.Response.End();&lt;br&gt;HttpContext.Current.Response.Flush(); &lt;br&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7656953" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="asp.net" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/asp.net/default.aspx" /><category term=".net" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/.net/default.aspx" /><category term="c#" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/c_2300_/default.aspx" /></entry><entry><title>Simple Pleasures in SP 2010:  TryGetList method</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/peterbrunone/archive/2010/10/05/sp-2010-joy-trygetlist-method.aspx" /><id>http://weblogs.asp.net/peterbrunone/archive/2010/10/05/sp-2010-joy-trygetlist-method.aspx</id><published>2010-10-05T17:19:00Z</published><updated>2010-10-05T17:19:00Z</updated><content type="html">&lt;p&gt;How many times has this happened to you?&lt;/p&gt;

&lt;p&gt;SPSite site = new SPSite("url");&lt;br&gt;
SPWeb web = site.OpenWeb();&lt;br&gt;
SPList list = web.Lists["ListName"];&lt;br&gt;
ERROR!!! &lt;/p&gt;&lt;p&gt;...because, of course, that list happens not to exist!&amp;nbsp; Have you ever wished for a better approach than either "Try...Catch" or "loop through the whole mess"?&lt;/p&gt;&lt;p&gt;You just got your wish.&lt;/p&gt;&lt;p&gt;SharePoint 2010 includes a brand-new method on the SPListCollection, called &lt;b&gt;TryGetList&lt;/b&gt;.&amp;nbsp; This method returns a list if successful, but if not, it returns -- get this -- a null value!&amp;nbsp; No more clumsy extra logic blocks every time you need to do something simple like grabbing a list.&amp;nbsp; It's not rocket science, but the great innovations rarely are.&lt;br&gt;&lt;/p&gt;

&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7623945" width="1" height="1"&gt;</content><author><name>PeterBrunone</name><uri>http://weblogs.asp.net/members/PeterBrunone.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint Customization" scheme="http://weblogs.asp.net/peterbrunone/archive/tags/SharePoint+Customization/default.aspx" /></entry></feed>