Wednesday, June 23, 2010

Overcoming Read-Only Condition in Datasheet View

I ran into a situation while working on a SharePoint calendar that was set up to require approvals. We decided to add a new column in order to create sub-calendar views that would be filtered off of this new column. The problem was that we had several hunderd events already entered into the calendar, and the thought of opening each item and editing its contents to insert a value in the new column made my user's eyes roll back in their head.

The obvious solution was to use the Open With Access option on the actions menu of the calendar however, after opening the calendar with Access, none of the cells were editable. OK, let's try something else; I selected the All Events view of the calendar and selected Edit in Datasheet, which was now available from the Actions menu. Foiled again, any attempt to edit the cells poped up a Windows Internet Explorer dialog box with the message "The selected cells are read-only."

The solution was ultimately derived from Larry Kuhn's Simplify List Item Approval using the Datasheet View. It seems that the Approve/reject Items view of a list that requries approval for items allows the Approval Status to be edited.

A few clicks reveals that all the columns in this view are editable, so I added the column for my new filter field to this view and then was able to use this Datasheet view to quickly update hundreds of event records in short order.

Tuesday, June 15, 2010

SharePoint Alerts: Workflow

Overview

The Workflow for SharePoint Category Alerts as described in the overview post is a SharePoint Designer workflow. This workflow is used on the Master Calendar list to set the StatusType based on that status of the event: Approved, Pending, or Rejected. The StatusType field is required due to the fact that you cannot access the Approval Status field in a formula for a calculated field. The calculated fields BGColor, Border, and Color use the StatusType field for applying the appropriate color based on the event's Approval Status.

Setting up the Workflow


On the Master Calendar SharePoint list set the following Conditions and Actions within an If/Else if structure:

Condition: If Approval Status equals 0;#Approved
Action: Set StatusType to 0

Condition: Else If Approval Status equals 1;#Rejected
Action: Set StatusType to 1

Condition: Else If Approval Status equals 2;#Pending
Action: Set StatusType to 2

Condition: Else If Approval Status equals 3;#Draft
Action: Set StatusType to 3

Condition: Else If Approval Status equals 4;#Scheduled
Action: Set StatusType to 4

That's it for the workflow. This workflow should be set to run Automatically when a new list item is created.