Friday, 31 July 2009

Sharepoint Designer and Workflows

As mentioned in my previous post, in order to get the Help Desk functionality we required I had to start creating some workflows.

To try to keep things simple and understand how Sharepoint and Workflows work at the top level I decided I didn't want to have to write any code. This means using Sharepoint Designer to design Workflows.

In case you don't know what a Sharepoint Workflow is, it's basically a step by step process that allows you to update Sharepoint lists, collect information from other users, send out notification emails and other things like that.

A workflow can be started when a list item is created or updated, and can also be started manually by a user. The problem I mentioned before, where I wanted to automatically set the Customer field of an item based on the person that reported the problem, would be an example of a workflow that runs whenever an item is created or updated. A user initiated workflow might be one that a user chooses when they want to close a call; a new task is created and assigned to the support manager asking them to review the content of the call and approve or reject the close request.

Sharepoint Designer provides a 'friendly' way of editing Sharepoint pages and creating simple, but relatively powerful, workflows. This used to be a paid for tool, but now it's a free download.

Microsoft Office Sharepoint Server Workflows are based on Windows Workflow Foundation. When you design a Workflow with Sharepoint Designer it generates the mark-up required to describe the Workflow and any user input forms needed to get data from a user. You design the Workflows by entering simple step by step instructions.

As an example, here's the logic of the Customer field update workflow.

  1. Get value of Customer field from the Contact's record referenced in the Reporter field of the current list item (the list item that has changed causing the workflow to run).
  2. If the value of the customer field of the current list item is not equal to the value above, then set the value.  (As the workflow is started whenever an item is changed, you should only change the value if necessary, otherwise the workflow will be started over and over again).

I found putting together a Workflow relatively simple.  Although the way you specify the data you want to lookup, and the relationship it has to the current record is a bit confusing until you understand how it fits together.

Wednesday, 8 July 2009

Sharepoint Help Desk Reporting

Reports Requirement

In order to move our Help Desk to Sharepoint, one of the requirements is the ability to run monthly reports for some customers. Currently these reports contain a list of all calls that have been opened, all that have been closed and all that are active within a month. The reports go out in PDF format.

SQL Reporting Services

I wondered if SQL Server Reporting Services could generate these reports for us, but after fiddling around I couldn't seem to get these to work properly. I read some articles about it, and it's possible (using the Sharepoint web services stuff) but it would probably have been a lot of hassle and a bit of a maintenance nightmare! It seems that SQL Server Reporting and Sharepoint integration is a relatively new piece of functionality, and it's something I reckon Microsoft needs to work on improving.

Access and Lookup Fields

After giving up on SQL Reporting I tried using Access to generate the reports, and this turned out to be pretty easy. One thing that I did need to do was create a new field for the Support Call list that contains the customer that owns that call. Originally, the list just had the reporter in and you could get the customer by following the link to the reporter's details (each reporter works for one of our customers). But in order to do customer based reports, adding the customer field in to the list was necessary.

I thought that automatically setting (or restricting) the content of one lookup field based on the content of another lookup field might be something that Sharepoint supported within a list definition. This isn't the case, and in the end I had to write a workflow that sets the customer field based on the content of the Reporter field.
This kind of one-removed relationship does seem to be a bit of weakness in Sharepoint. I've seen you can get 3rd party solutions that allow you to do this, but really I reckon this should be a standard feature in Sharepoint.

Anyway, workflows aside, the end result was a simple form that lets you define the month and the customer, click a button and the PDF is generated. This Access generated report looks better than our old one, and it was easy to add extra bits such as a simple pie chart showing the state of all the support calls active within the chosen month.

Tuesday, 7 July 2009

C# and the CLI gets Microsoft Community Promise

I’ve just read on Miguel de Icaza’s blog that both C# and the CLI are getting the Microsoft Community Promise patent licensing applied to them.  That basically means that MS promise not to sue anyone for implementing the specs, regardless of how they do it.  Quite timely given my recent post.

From the announcement:

It is important to note that, under the Community Promise, anyone can freely implement these specifications with their technology, code, and solutions.

You do not need to sign a license agreement, or otherwise communicate to Microsoft how you will implement the specifications.

The Promise applies to developers, distributors, and users of Covered Implementations without regard to the development model that created the implementations, the type of copyright licenses under which it is distributed, or the associated business model.

Under the Community Promise, Microsoft provides assurance that it will not assert its Necessary Claims against anyone who makes, uses, sells, offers for sale, imports, or distributes any Covered Implementation under any type of development or distribution model, including open-source licensing models such as the LGPL or GPL.

Good news for Mono.  Maybe some of the anti-Mono types will back off a bit now; although some how I doubt it.