Supernova’s Mission

Supernova’s mission is to share our people’s stories, ideas, discoveries, and solutions.

Archives

“Versioning” Update

Written by:

So the customer came back with a change to the “Versioning” request which was instead of Displaying the date to display the “Version” count.  This has lead me down an interesting change of the workflow which included the addition of a List to hold the version count as well as a calculation in the work flow which is no a couple of steps longer.  The “ChangeTitle” step was not changed at all however the “ChangeName” field was changed due to the numbering system rather than the date.  I also had to change the NameDate Field to be the NameCount Field which changes the file name to “%FileName%-%Version #%.” The custom list for the version number is also going to be used to assist fellow MSS employee Chris Lincoln in creating a JavaScript Mouse over in the Document Library showing the Description of each grouping or reports by title, which in itself will be a pretty cool blog entry for next week!  Please see my previous blog post here to get the background of this issue/resolution.

The Document Library drives this Workflow not the List.

As seen in the previous blog, Step 1 is the ChangeTitle step and this copies the File Name into the Title Column, the rationale was to maintain unique file names but keep the documents grouped by non-unique Titles.

Step 2 is new and it is the “CreateListItem” step.  This creates the item in the list if it not already there.  Validating that it is not there maintains only one record in the List while allowing for multiple records in the Library.  I validate it off of the current item (Document) title but it ensures that there is no such record in the List which maintains an accurate “Version” count.  Once this validation has completed the list Item is completed, if there is already an item with like Title in the list it skips to Step 3 which sets the Version count.  The Item is created the Title is copied from the Current Item (Document) and the Version Count is set to 0.  Please see the Screen Shots Below for “CreateListItem” Step.

Step 3 adds 1 to the current version # in the List.  If this is a new document it becomes Version 1, if it is an old document it is version x + 1.  We will use this field to create a variable to add to our New Calculated value we are calling this step “SetCount” and it updates the lists count and stores a “calc” variable.  The calc variable set in step three will enable the “Versioning” as seen in Step 4.  Please see the Screen Shots Below.

Step 4 has been modified slightly, as before the pause was to give time for the File Name to enter into the calculated value, since this step actually places the “Count” Value into the Item and Calculated Values pull from the Item itself the pause has been moved to below the input of the calc variable into the “Count” field on the current item.  The pause allows for the calculated value NameCount to wait for the Count variable to be added which takes about 30 seconds, however 1 minute is the shortest pause possible in SharePoint Designer.  Please see the screen shot below:

There will be a third post regarding this effort as far as adding the JavaScript mouse over tool tips for the groups by title in the default view.

IRequiresSessionState and long running Asynchronous HTTP Handlers

Posted on February 4th, 2012 in Technology, Tips & Tricks.

The other day I learned something interesting about the inner workings of ASP .Nets session state management.  One of the nice features it provides is automatically making usage of the session state thread safe between the various threads which may be handling requests from the same user (with the same sessionId). Apparently the way it

Setting up SSL on a Microsoft Azure application

Posted on January 24th, 2012 in Technology, Tips & Tricks.

Recently I as involved with adding SSL to a site which is hosted within Microsft’s Aure platform.  Overall the process went pretty smoothly having used the guide from MSDN: http://msdn.microsoft.com/en-us/library/windowsazure/ff795779.aspx   The one thing it forgets to mention is that along with server certificate you also need all of the certificates along the chain of trust back

Updating large quantities of data in SQL Azure

Posted on January 6th, 2012 in Technology, Tips & Tricks.

Recently I ran into a scenario where I had a production database which contained a table with 1.4 million records in which I wanted to convert a varchar column containing numbers to a bigint column. I used a backup of the database to try out a few different methods; at first I tried simply running

Handy String Parsing Extension Methods

Posted on November 4th, 2011 in Technology, Tips & Tricks.

Since I’ve never particularly liked the feel of C#’s int.TryParse and bool.TryParse methods I decided to create some extension methods for strings which I feel like make the code using them much more readable:   /// <summary> /// Converts a string to an int, if the string cant be parsed then null is returned /// </summary> ///

MetroStar Systems Supports the 36th Marine Corps Marathon

Posted on November 2nd, 2011 in Our Culture.

It was 3:45a.m., Sunday October 30th…Theresa and I sat in my car with the heat on full blast gearing up to be outside for the next six hours (at least!). It was still dark as night, but not far in the distance you could see the buzz and commotion of people setting up for one

Linq to SharePoint vs. CAML vs. SQL Performance

Posted on October 25th, 2011 in Technology.

On a project I’ve just recently started I was tasked to create some SharePoint web services which would serve up data stored in lists.  Having learned recently about a new tool for SharePoint 2010 called Linq to SharePoint I decided I would give it a try rather than taking my normal approach of using CAML

FedTalks2011

Posted on October 13th, 2011 in Community, News, Technology.

I had the pleasure of attending FedTalks2011 – an event held October 11, 2011 at the Warner Theater in Washington D.C. The event was hosted by FedScoop and brought together “the greatest minds in government and business technology to discuss how innovation can aid in the way government works.” I was introduced to top White

Jenny’s SharePoint Tip: Rollup items across a site collection by creating a cross list data view web part.

Posted on October 3rd, 2011 in Technology, Tips & Tricks.

While working on a client project I had a request to rollup all  calendar items across a single site collection on the home page of the root site.  After reviewing several blogs describing how to create a cross list data view web part (dvwp) I was able to successfully create a solution per the client

Jenny’s SharePoint Tip: How to display “This Month” birthdays in a list using an XSLT filter

Posted on September 30th, 2011 in Technology, Tips & Tricks.

Anyone who has ever worked with SharePoint knows that creating filters on date values is not as straight forward as one would expect.  This example explains how to compile employee birthdays in a custom list that automatically displays only the current month’s birthdays.  With a few calculated columns, a data view, and minor XSLT this is easy to

Using PowerShell to Update Content Editor Web Parts

Posted on September 20th, 2011 in Technology, Tips & Tricks.

Have you ever been in a situation where you needed to programmatically update the content in Content Editor Web Part (CEWP)? Maybe you added some HTML that is breaking your page or maybe you’re moving your content to another domain and you have some hard coded links in your CEWP’s.

Well it turns out that it isn’t really that hard. In my situation we were working with the latter scenario above and within our environment we have many administrators who have created hard coded links within CEWP’s and in order to streamline the upgrade process I thought I would create a PowerShell script…

Posted on September 20th, 2011 in Technology, Tips & Tricks.

Leave a Comment