An interesting look at how to get items from your SharePoint list. I didn’t know about the datatable view. Guess it can’t do a bulk update though.
Author: Andy Burns
Dude, whats my column type?
Some weird behaviour with SharePoint column types, and the data you get by looking at the SPListItem.properties hash.
So, I’ve got a document library, and I’ve added 3 extra columns to it. For simplicity, I shall call them ‘Text’, ‘Number’ and ‘CheckBox’. I filled in some data for them – a number in the Text field, the same number in the number field, and I check the checkbox for all of the items. I end up with a list looking like below…

So, for now, let’s ignore the fact that the value for some of the longer numbers has been rounded in one of the fields – and not ask why MOSS didn’t just complain that the numbers were too big. Instead, let’s ask what the column types being used are… Continue reading “Dude, whats my column type?”
Power Supplies
So, I’ve had two power supplies blow on me in the last 6 months, for different things. My wireless router died, and my home laptop’s power died a couple of days ago.
This strikes me as very wrong. It’s not like they had to do anything complicated – they’re just transformers. The technology has been understood for a long time. I mean, batteries are one thing, but transformers?
The complication then comes that there are dozens of almost identical connectors, and finding out what connector you had is hard work.
So, couldn’t electronics companies build better power supplies? With fewer ‘standard’ connectors (and none of this proprietry bollocks like some laptop manufacturers use – there’s no need)? And perhaps some system of colour coding, or at least documentation of what the connector is? Would that be too much to ask?
Note about a Windows Service writing to the event log
I was using the System.Diagnostics.EventLog.WriteEntry function, and I kept getting a System.security.securityException about “requested Registry access” not being available. Well, a note for myself – use localsystem not localservice as the account to run under – then it is fine!
Why I wrote simplyxiangqi.com
A long time ago, my Dad got me the game ‘Battlechess 2’. Much time my surprise, it was some strange variant called ‘Chinese Chess’, and I enjoyed it (even though I’m not much good). It doesn’t have the whole ‘pawn-shuffling’ start or drawn out end games, so it appealed.
A lot of time passed, and I became a developer. One day I was looking at an online chess site and I just thought ‘I could build this’. I had recently started learning about JSP and Servlets to work towards Java Web Developer certification. So, I sat down, worked out the logic, learnt about ‘bit boards’, and build the engine for working out valid moves, given a position. And I wrote it all in Java.
After that, all I had to do was build the website to support that engine, and at this point I stalled. Building websites out of Java was excessively hard – security filters for login, carefully planned data structures, lots of JDBC to connect to the database. To be honest, the hard problem cracked, I lost interest.
Time passed. I started to read about this new thing ‘Ruby on Rails’, and so I thought I should take a look. I went through a couple of tutorials and I was impressed. In minutes I could make a (very basic) site that dealt with security, database interaction, etc., pretty much for me. I just thought “Now this is a simple way of building that site”. So, I did.
I ported my code from Java into Ruby in about 4 hours – most of which was getting to grips with the Ruby language itself. I built a database schema, and based the site around that structure.
And that’s pretty much where simplyxiangqi came from.
Reflections
More on Delay Activities, Workflow, and Beta 2 Tech Refresh
I’m coming to the conclusion that Beta 2 TR has broken Delay Activities…
What I did was build a test workflow. I’d got delay activities that weren’t working, and I wanted to investigate the possible factors involved.
I know that they were working just fine in Beta 2. I thought the difference here from what I was doing in Beta 2 was that I was setting the TimeoutDuration at runtime, through the InitializeTimeoutDuration function.
So I built a test workflow with 2 different parallel branches. One had a ‘static’ (design time) configured delay, and the other had a ‘dynamic’ (runtime) set delay. Both had an InitializeTimeoutDuration function set, though for the ‘static’ case all this did was log that it had been invoked.
I ran the workflow. My log file showed that the workflow ran both the InitializeTimeoutDuration functions, and nothing else.
Previously, I’d not run that function at all, so I tried configuring both Delays to not call InitializeTimeoutDuration. I ran the workflow, and again, nothing after the delays ever happened.
So I thought maybe it was because I had 2 delays. I disabled one sequence, and added a new second sequence that just contained a code step. I ran this – and again, anything after the Delay activity was never run.
In the end, I took one of the sequences outside the Parallel Activity. The workflow was now OnWorkflowActivated – Code – Delay – Code. And the second code step never runs.
I know this worked in Beta 2 – has the Tech Refresh broken this?
Comments from my old blog:
I got the same impression 😉 – Beta 2 TR has broken Delay Activities…
The frustration of Parallel activities
So, I came across an interesting situation.
I have be told to look at trying to build the workflow I’ve been working on (a state machine workflow) as a sequential workflow.
In this workflow, I need to run two parallel tasks. On one side, I wait for a task to be completed, and on the other, I want to have a delay step followed by an email activity, to send the reminder email after a delay.
The problem is, the ParallelActivity step will only complete when BOTH branches have completed. I can’t stop the branch with the email. In other words, the user finishes their work on the step, but the workflow won’t continue until the reminder email sent!
Equally, if the delay step was some sort of escalation process (rather than an email, it wouldn’t be able to escalate until the user had finished with the step!
There has to be a way around this, I’m not sure what I’m doing wrong though.
Comments from my old blog:
Hi,
you have to use an Listen activity, probably inside a while activity.
Note: the createTask activity you have to put outside the while.
Yup, I realised I was being a bit slow – and that an event listener activity could have multiple branches, and completes when any of the events is done. I don’t think I’d need a while loop, though.
I was just using the wrong activity type.
Setting DelayActivity.TimeoutDuration at runtime in WSS3 workflows
I need to use DelayActivity steps to ‘hold’ the sending of some notification emails until the correct time. That time is to be set at runtime.
However, it appears that in State Machine workflows the TimeoutDuration of a DelayActivity can only be set at design time. Trying to set it at runtime causes the DelayActivity to never expire.
I tried the same for a sequential workflow, and it worked okay. It seems this only affects State Machine workflows in SharePoint 2007 (MOSS)
EDIT: correction, it DIDN’T work okay in a sequential workflow. I’m sure I did this before, though. Perhaps it’s broken in Beta 2 TR, or maybe my memory is failing.
"Send to" and the Lutz Reflector
Neat tip for .NET development. Put the Lutz Reflector into the context menu in windows.