Set SharePoint BDC field value programmatically in Visual Studio workflow

The Business Data Catalog (BDC) in SharePoint is a superb way of hooking up virtually any disparate system to SharePoint 2007. By defining the connection in to the system, you can expose any part of the system to SharePoint, and harness some of SharePoint’s real power - for example, its powerful search capabilities. Once you’ve created your connection (your Line Of Business [LOB] system), you can attach BDC columns to any list (e.g., document library) and you can, for example, have a document with a reference to your other system, so that you can permanently associate extra data to your document, without having to reproduce the information in SharePoint and create unnecessary duplication.

Using the BDC is beyond the scope of this post, but I’d like to cover an issue that I recently encountered when trying to work with the BDC and a document library. I had a fairly simple Visual Studio 2008 workflow that ran when a new item was created in the document library.

Read more

Simplified SharePoint solution deployment

Any SharePoint developer will have to work with SharePoint Features at some point. Features are a great way to extend the core functionality of MOSS - in Web 2.0 speak, think of them as “plugins” and you’ll understand why they’re useful. Features can take a variety of forms - workflows being one of them. I’ve discussed in the past the usefulness of SharePoint Designer for workflow creation and eventually you’ll need to move to Visual Studio. Features (and workflows) can be designed directly in Visual Studio - support was added in 2005, but its support is further extended in 2008 - Visual Studio will generate all the required bits you need to actually get the workflow ready to be deployed to your SharePoint environment and gives you the all important debugging and code step through stuff. There’s a nice guide to the basics of workflow and Visual Studio.

Read more

Extend SharePoint Designer's workflow activities

SharePoint Designer 2007 is a useful tool for performing quick tasks in your SharePoint environment. It’s moreorless Frontpage on steroids, but it’s designed to interact directly with SharePoint installations. I’ve used it almost exclusively to create simple workflows - simple being the operative word. And what’s more, it’s now free! You’ll need the likes of Visual Studio to do anything complex, but for every day use where you don’t want to worry about packaging up solutions and features and getting involved with stsadm, SharePoint Designer definitely has its place.

Read more

Updating Alesis DM5 drum machine firmware

I recently updated the firmware on my Alesis DM5. The update has been around for ages, but I didn’t have the interface between the DM5 and my PC. I was in limbo about it all - I was looking at the Midiman Midisport 2×2 but I felt a bit aggrieved spending some thirty quid on something I was likely to use once. (I already have a M-Audio Pro 44 keyboard that hooks the kit in to my PC.) I finally bit the bullet and trusty old eBay turns up a nice and cheap USB Midi interface - I was dubious about something for £0.98 - whether it would really work.

Read more

Reporting a product bug to Microsoft

I needed to update our installation of SQL Server 2008 to include Integration Services so that maintenance plans would run. I have local admin privilege on the machine, but as with most Microsoft related installation tasks, you routinely get so far through the process and you’re hit with the SeSecurityPrivilege error - that is, you don’t have some permission or other. The installation process goes wrong and you have to cancel out of the whole process in order to restart it with an account that has the privilege.

Read more

How to remove a Datatool System 3 from a Honda CBR600FX

Way back when, I thought an alarm on my motorbike was a good idea. My bike had just been vandalised by a drunk and I had become a bit paranoid. And, in fairness, since having it, my bike was never stolen. Admittedly, I’m not certain there were actually any attempts to steal it. The times that the alarm did get triggered was always me, or an ant looking at it and setting off the motion detector, and even on those occasions, any passers-by in the vicinity barely gave it a glance before moving on and ignoring the apparent attempted theft of my bike. Had I been trying to steal my bike, then I doubt the alarm would have done much to prevent it. Seems to me that alarms are pretty ineffective nowadays. Moreover, I can think of at least one easy way to completely disable it with very little fuss.

So when I recently had to replace my battery again due to its inability to maintain a charge - no doubt caused by the permanent drain that the alarm system puts on it - enough was enough, the thing was coming out. It was surprisingly easy to do, which made me wonder about its status as Thatcham approved and all that. It took the installer quite a few hours to put in - he did do a proper job - but I’d say it took me around 20 minutes to get it out. Not something you’d do on the side of a road in order to nick it, but still, surprisingly easy. And to think I paid around £400 at the time.

This isn’t supposed to be step by step instructions and I won’t describe how to dismantle your bike or get at the particular pieces - if you can’t work out that much on your own, you probably shouldn’t be doing this. And needless to say, but it needs to be said, this is what I had to do to my own CBR600… no guarantees it’ll work for your bike or be the same or anything. And I’m by no means an electrician. So if you permanently immobilise your bike - it ain’t my fault! And note that my alarm was functional but I had taken a rather unconventional route to completely disable the bike before I did this (took out the main fuse for the bike) - so the alarm actually wasn’t alive.

Read more

Force comment entry when editing a list item

Quick tip: custom lists are a great way to store data about a business process or operation that doesn’t necessarily fit in a standard list. They can be used to store virtually any type of data, that makes sense in list form. For instance, you might record the configuration details of all the switches on your network. They’re especially helpful in that by enabling versioning on a list, you can create an audit trail of when things changed. Critically, though, when something changes, you’re likely to want to know why. Therefore, when someone changes an item, you might want to insist that they add a comment to quickly describe the change they have made, and why.

Read more

Canon IP5200R wireless printing + OSX 10.6.* Snow Leopard

If like me you found that your previously perfectly working Canon IP5200R wireless printer is broken after upgrading to Snow Leopard - don’t worry, there’s (now) an easy fix. The long and the short of it is - in 10.6 they included an old version of the Canon printer driver. Useful, huh?

These tips are for UK based people - if you’re elsewhere, you should find the appropriate place on the Canon website to get the updates.

Read more

Workflow error help: failed on start and more

One of the major selling points of SharePoint is the power of workflows. Designing very basic sequential workflows in Sharepoint Designer 2007 is a very straightforward task using the workflow designer wizard. But unfortunately straightforward is the key word here, as you are limited by the functionality available to you in SharePoint Designer. Simple tasks (e.g., update an item, send an email, etc.) are doable, but, for example, you can’t do any string manipulation other than building “dynamic strings”. So even creating a suitable subject line to an email can require a complicated collection of variables and such like. SPD workflows are also very much “single use” - i.e., they start, they run, they finish. They can wait and so on, but complicated business logic is pretty difficult to program. At that point, you’ll need to get involved with Visual Studio. That’s not without its difficulties, however, and as someone coming from a Visual Studio software background, creating workflows can be a minefield. Certain expectations you may have with Winforms just go completely out the window.

Read more

Business Data Catalog tips, hints and errors

A few tips/hints from my experience in working with the Business Data Catalog Definition Editor to create line of business (LOB) application definition files for use in Sharepoint MOSS 2007.

  1. Create a _SpecificFinder method - b_y default, BDC DE doesn’t create a SpecificFinder method. You’ll need one for use in Sharepoint. More here.
  2. Wildcard search - When creating a Finder method (for use with e.g., a Wildcard search) make sure the wildcard character is defined - which is done in the very topmost node of the tree (i.e, the LOB node.) Without it you might find the query runs, you just get no results. Where you’re using SQL Server, the Wildcard character by default is %.
  3. Multiple Finder methods - You can create multiple filters on a single finder method, just make sure you specify default values and update your e.g., SQL select statement so instead of e.g., where name like @name you change it to where name like @name and date_create > @date_create_gt… etc.
  4. “Provided stream is invalid” - If you get this error “The provided stream is invalid (not of type IDataReader, IEnumerable or IEnumerator). Parameter name: rawAdapterEntityInstanceStream” first thing to check is that your return parameter is the last one physically specified in your file.. i.e., you can have multiple in parameters, but the return parameter has to be last in the list. The way to fix this is export your application definition file (to XML), then manually adjust the order of the parameters, then reimport to BDC DE.
    4a. Note: If you make manual changes to your ADF file and want to reimport to BDC DE, you have to delete the original definition from BDC DE first.

For reference, there’s a really good series of articles on basic BDC stuff, right about here.

Read more