?

Log in

Hi there, ordinary blog readers! Unless you’re a SharePoint developer, this entry isn’t for you. I’m putting this up to save future developers the head-against-wall-banging that I encountered while trying to fix this problem.

So, I’m kind of new to SharePoint, so naturally, the first thing I should be doing is writing a crazy insane workflow, right?

I’ve got a workflow where a project manager approves a project (that’s one kind of task), or can send it out for technical review (another kind of task), or can request more information from the user (yet another task). Each of these tasks have their own Content Type, and their own custom task edit form in ASP.NET. (Because I hate InfoPath with a burning white hot hate.)

Whenever someone uses one of these custom edit forms, however, I get a NullReferenceException. The stack trace always puts it in the non-public SPListItem.PrepeareItemForUpdate method. It doesn’t matter how I change the task list item. Using SPWorkflowTask.AlterTask, or just SPContext.Current.ListItem followed by Update all threw the NullReferenceException.

To Google I go! However, most of the results said that it had to do with not having a <FieldRefs> definition in the Content Types. That wasn’t my problem, however, since not only did my Content Types have FieldRef’s, but they were very much full.

At my wits end, I broke out the .NET Reflector and decompiled the Microsoft.SharePoint assembly. Here’s what I found:

As you can see (well, kind of see… click on it to see more clearly), this would only happen in a WorkflowTask. If the list item’s “Completed” field is null, the cast to bool throws a NullReferenceException. This is probably the kind of thing that can’t happen in SharePoint Designer, but only would occur when someone is mucking about in Visual Studio.

To fix it, make sure you set the “Completed” field. I do this:


private void SetTaskStatus(string status, bool taskIsComplete) {
      SPListItem taskItem = SPContext.Current.ListItem;

      Hashtable taskData = new Hashtable();
      taskData[SPBuiltInFieldId.TaskStatus] = status;
      taskData[SPBuiltInFieldId.Completed] = taskIsComplete;
      if (taskIsComplete) {
        taskData[SPBuiltInFieldId.PercentComplete] = 1;
      }

      SPWorkflowTask.AlterTask(taskItem, taskData, true);
    }

Or, if you work for Microsoft, you could do us a favor and make sure that you null check that line and default to false. (It’s entirely possible that this has been fixed by SP1, but my production server doesn’t run that yet, so I can’t either.)

Originally published at The Many Hats of Jason Specland. You can comment here or there.

Benjamin Meets Alton Brown

Benjamin meets Alton Brown of FoodTV’s “Good Eats” and “Iron Chef America.”

Benjamin and Alton Brown

Originally published at The Many Hats of Jason Specland. You can comment here or there.

I scanned this drawing last week, with the intention of posting it here. At the time, Benjamin explained to me what it was, and I thought it was terribly cute. Looking at it now, I’ve forgotten what he said and can’t quite fathom why he calls it, “Alice In Wonderland.” I therefore present it without further comment:

Originally published at The Many Hats of Jason Specland. You can comment here or there.

Benjamin’s Drawing of the Day: Music

Recently, Benjamin’s made kind of a quantum leap in his development. Before, he wouldn’t pick up a pen or pencil for anything. Now, he absolutely loves to write and draw. His drawings have quickly evolved from random scribbles, to actual discernable shapes, to recognizable themes and extreme cuteness.

With that in mind, I now designate this blog as my virtual refrigerator. Behold! The art of Benjamin Specland!

This one he calls, “Music.” The lowercase b things are musical notes. (I guess he’s fond of the half-note.)

The person in the middle is Benjamin, playing the piano. At the bottom is me playing guitar, and Paula playing the tambourine.

Originally published at The Many Hats of Jason Specland. You can comment here or there.

Over the past year, I’ve made a lot of new friends. However, many of these new friends don’t know how incredibly awesome and talented my wife is. Sure, they hear second-hand accounts from me, but nothing beats seeing the awesomeness live. That’s why all of you (and I do mean all of you) should go see The Icky House Club this Saturday night!

(A video of the Icky House Club performing appears below. If you’re seeing this somewhere where that video doesn’t appear, just follow the links to the original source. You won’t regret it. Well, maybe you will if your significant other sees how sexy the members of this band are and abandons you immediately to become a groupie.)


Live 104 Presents
the Icky House Club Live!
9PM Saturday, Feb. 19th.
Cin-M-Art Space43 (43 Murray Street between West Broadway & Church Street)
21+ only

Originally published at The Many Hats of Jason Specland. You can comment here or there.

Why I Dress

On two separate occasions recently, people have asked me why I dress the way I do. On both occasions, I was onstage or about to go onstage, so I answered, “The answer is complicated, and I can’t talk about it right this very moment. If you really want to know, ask me later.” Unsurprisingly, neither followed up. So, in the tradition of answering questions for which nobody really cares about the answers and serve only to stroke the ego, I present the answer.

Those of you who know me but haven’t seen me in a while may be wondering what the hell I’m talking about. While I haven’t been a tee-shirts-and-jeans guy since I stopped working for dot-coms, until recently I generally wore what I affectionately called “the Khackiverse.” Perfectly normal and acceptable for a not-formal-but-not-a-startup computer-guy job. Lately though, I’ve been “upping my game” as they say, by generally wearing at least a sportcoat and often a tie all the time. In fact, right now I’m wearing a suit and I’m not even going out for an interview.

Why? Several reasons.

First, it just looks nice. Every girl’s crazy for a sharp-dressed man. (Especially my wife.) And if there’s anyone I trust for guidance with style, it’s ZZ Top. Okay, so I don’t actually trust them about style, but I do trust them to write quotable lyrics about style.

Second, for the same reason I generally don’t wear tee-shirts with logos and funny sayings on them anymore. I’m a man with a job and a family, not a boy. Several years ago I did a massive tee-shirt purge and felt better for it. This is just a natural continuation.

Third, because I appreciate the theatricality of dress. So much so, that I’ve been trying to dress as nicely as possible when performing. Improv naturally has no costumes, and people perform in whatever they wear on the street. Which considering society at large, is tee-shirts and jeans. But I’ve always appreciated people who recognize that performing is presentational. I’ve always loved bands who wear suits, for example. It says, “I’m doing a show. It is an occasion.” I felt this way even before I took Ali Farahnakian’s Level 5 class at the PIT, but Ali kind of cemented for me. He advised always to dress one step nicer than your audience. “If they’re wearing tee-shirts and jeans, you wear a jacket and tie. If they’re wearing jackets and ties, you wear a tuxedo. If they’re wearing tuxedos, you wear a white tuxedo,” he said, my paraphrasing memory not withstanding.

And so, when I perform at the PIT this evening, I’ll be wearing a beige suit with faint pink and black checks, a light blue shirt with thin olive stripe, a blue wool tie with a black and white plaid pattern, and a pair of buckle loafers that I got cheap on eBay. And also, a bright-red PIT bar napkin that I’ll use as a pocket square. Just ’cause.

Originally published at The Many Hats of Jason Specland. You can comment here or there.

Watson! Come Here! I Want You!

Your attention, please. The improv team formerly known as “Team Green” is now known as “Watson.” That is all.

Originally published at The Many Hats of Jason Specland. You can comment here or there.

Everyone at the PIT already knows about this. But for my non-PIT friends, if you’ve ever rode in a New York City taxi and didn’t bother to hit the “turn off this damn video” button, this is for you:

This project is being done by Scott Eckert, a teacher, mentor, and friend of mine from the PIT. Also, if you ever have an opportunity to see him perform improv, that is an opportunity of which you should avail yourself.

Originally published at The Many Hats of Jason Specland. You can comment here or there.

How to tell your child has an interest in dance. Lesson 1:

Maybe it’s time for dance lessons…

Originally published at The Many Hats of Jason Specland. You can comment here or there.

You Never Forget Your First

On Wednesday, the team that will shortly be renamed but is currently known as Team Green performed their first show at The PIT. I alluded to how it felt in a brief Facebook status update*, but the feeling was so intense that I needed to record it here.

It. Was. Amazing.

Even though the theater is brand new, between open jams and auditions I’d been on the stage plenty of times by now. But when the house is full, as it was Wednesday, the energy is just entirely different. The stage was electric. The laughter fell over us like an intoxicating tidal wave. It was a feeling I haven’t felt since… well… the last time I had a major role in a show before a huge, full house. (Rocky Horror? We didn’t quite sell that out. Ragtime? My part was comparatively minor.)

There were certainly some rough patches. We’re still kind of feeling each other out, finding our group mind. We’d never even rehearsed before, for goodness sake! But based on the positive response we got on our first time out, I’ve got a feeling we’ve got a lot of amazing performances ahead of us.

* I find myself experiencing a strange hierarchy of “publishing thoughts on the Internet.” I’ll start on Twitter, where I will try and lovingly trim my thoughts down to 140 characters. If I absolutely can’t trim it that far, it goes to Facebook. Then, when I finally feel the need for paragraphs and permanence, it ends up here.

Originally published at The Many Hats of Jason Specland. You can comment here or there.

Latest Month

July 2011
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Tags

Syndicate

RSS Atom
Powered by LiveJournal.com
Designed by Tiffany Chow