Nick Hadlee's Blog on SharePoint and Other Occasional Rants…

Christchurch SharePoint User Group Session 26/10/10: SharePoint Development With Visual Studio
October 27, 2010, 10:08 pm
Filed under: 2010, Development, SharePoint, SPUG, Tips & Tricks

I did a joint presentation with Alex Dean at the Christchurch SharePoint User Group which was a brief overview of SharePoint Development 2010 with Visual Studio 2010 and a discussion of some (not all) of the challenges. Alex kicked it off and did a great introduction and then I talked about a few of the problems I have experienced and how they can be worked around.

A big thanks to Alex for coming down from Wellington and doing two presentations. Great effort!

The slides (and of more use the links inside them) are on SlideShare and embedded below:

Code Camp Session: SharePoint 2010 Developer 101
September 7, 2010, 9:31 pm
Filed under: 2010, Development, Presentations, SharePoint

During the recent (August 29, 2010) Auckland Code Camp a buddy of mine Chaks had to pull out of a planned SharePoint 2010 developer session. Luckily Chan and myself were on hand to put together the following session which is a high level overview of SharePoint 2010 Development.

Feedback is always welcome on these sorts of things…but be kind we only had a couple of hours to prepare 🙂

New Zealand SharePoint Conference – Day One Tit-Bits
June 9, 2010, 6:07 pm
Filed under: 2010, NZSPC

The first day of the New Zealand SharePoint Conference is almost over and it has been a really good day with some great sessions and a lot of attendees. I managed to attend a couple of sessions in between being a “booth-babe” and there were some great extra things I didn’t already know that came out. Yes I hear you saying there is a lot of stuff you don’t know…[quiet in the cheap seats!]

SharePoint 2010 has sort of been out for quite some time because the Beta has been available since late last year so this isn’t yet-another-post on SharePoint 2010 and why it will change your life. It’s just a “things I reckon I need to remember” post.


I was lucky enough to see Todd Bleeker do his talk on REST and LINQ and for me a lot of this stuff was pretty interesting and a good refresh on things I had read but maybe not seen. So how easy is REST and LINQ to use? Very easy if your Todd! Anyway the highlights from his session were:

List Improvements

The improvements to SharePoint 2010 lists have been highly publicised for some time but its always good to refresh (I know I said I wouldn’t do this but lists are the lifeblood of SharePoint solutions so I’m making one exception):

  1. Relationships – if your using list lookups (the heart of many SharePoint based solutions) you can now enforce the list relationships between lists(lookups). This is either via restricted delete or cascading delete
  2. Joins – you can join lists when using LINQ to query them
  3. Data integrity – because of 1. you now can have proper data integrity in SharePoint lists that have these relationships defined.

Random Internet Explorer Tip

  1. Internet Explorer – Feed Settings to Help XML “Debugging”

    This was a very handy little tip for when you want to check some RSS or REST output via the browser (Of course the browser would be Internet Explorer right?). By default IE will make the data look nice (via a built in XSL stylesheet I assume) but you want the raw XML. How do you get it apart from a view source? You need to turn off the default behaviour in IE via the screenshot below:




  1. REST is AJAX’ian and nice and snappy for anything where you want no page post-backs. However if you want to do any aggregation (sums, counts etc) via REST then this automatically means it will be done on the client and that’s not really very efficient. What’s the better way? Do those type of “heavy” operations using LINQ so its all done on the server and then the result can be sent to the client. Ahhh…much better!
  2. A point came up from the audience (it was Adam Cogan I think) questioning whether using LINQ with SharePoint can be dangerous if the very likely situation arises that the underlying structure of the lists change (e.g. a user removes a field). The answer from Todd was yes that’s true and therefore you should couple the use of LINQ with SharePoint content types to ensure the fields that make up the base class created/used by the LINQ will not change!
  3. The DataContext – you make one of these with SPMetal which is a command-line tool provided by SharePoint. The bare minimum that SPMetal needs to work with is 2 parameters. One is the site url and the other is that type of class you want it to output (An extension like .CS or .VB) – seriously that sounds too easy!
  4. If you want to see the CAML generated by LINQ then set the .Log property of your DataContext object to a StringWriter and then you can see the CAML!
  5. The IQueryable interface (which is what the SPMetal generate class  implements) lets you output a List<> with the simple method .ToList() – again too easy!


15 Things Every Developer Should Know

Next up was Paul Swider with his 15 things a developer should know about SharePoint. Only 15? No seriously it was a lot of stuff to get through and the tit-bits that came out were:

  1. Start Visual Studio as the Administrator (Run As “Administrator”) if you want debugging to work nicely. This will let you attach to the IIS worker process
  2. Sandboxed Solutions. These were created as a result of developers writing bad code and bringing down the servers/farms. Ha ha I just found that funny enough to post!
  3. A sandboxed solution can be turned into a farm solution by toggling a property in visual studio and redeploying it. Good to know…
  4. The resource governor only works for sandboxed solutions but it would have be a good addition for farm solutions!

There was a question I still need to follow up:

  1. How can you query the term-store and term-sets via a web service? I’m thinking via a DataView web part or jQuery here.

Is it Code? – A Rant, Response and Example of Social Media’s Reach
June 5, 2010, 1:08 pm
Filed under: Cutomisation, Rant

First up a warning! This will appear to be post that has no purpose, meanders a little, and probably has no actual conclusion (also I use all sorts of weird colloquialisms). Appearances are often correct! I didn’t plan to write it but felt compelled to in response to some effort put in Jim (@dullroar) and Raymond (@iwkid). Honourable mentions to Marc (@sympmarc) for his championing of the ‘middle-tier’ (oh brother flames and brimstone await me for the use of that term) and Mark (@mrackley) for tackling a similar question previously. Ok, ok enough with the setup; let’s get on with the show…er post.

I asked what I thought was a fairly innocent question on twitter the other day but is anything ever innocent or innocuous when “thrown” out onto twitterverse or the interwebs? I was trying to validate the use of “codeless” when describing certain types of SharePoint solutions.

nickhadlee Poll: Is #XSL code? In the context of a ‘codeless’ solution 🙂 [Feel free to RT]

Why? Was I trying to deliberately rile people and get into some sort of tit-for-tat twitter banter going? No – absolutely not. The context of the question was aimed at what an end-user might consider code. A typical end-user might not even know what XSL is so the point is possibly moot. Really at the heart of my question was to define what we can call a “no code” SharePoint solution. I am a big fan of using the “no code” moniker and to quote Jim it is "probably more related to business politics rather than technical reality".

So what sort of response did I get? It started off pretty tame.

iwkid RT @nickhadlee: Poll: Is #XSL code? In the context of a ‘codeless’ solution <– I consider it "no-code" in that it is not managed/deployed

kennethprice @nickhadlee I think xsl is within boundaries of codeless solution.

Off I went to bed thinking that was that. 3-0 to the “it’s not code” camp and the “codeless” term can be applied liberally. Hmm that’s what I thought. Overnight Jim and Raymond decided to put pen-to-paper and expand their thoughts on the topic past the 140 character limitations of twitter:

dullroar @nickhadlee @iwkid @sympmarc My (long) answer to the poll:

iwkid @dullroar @nickhadlee @sympmarc @EUSP My response 🙂

Not to mention I irked Marc a little. Marc and I chat a bit on the interwebs so I knew the responses were all in good humour (I think…Marc we still talking???):

sympmarc RT @nickhadlee: Poll: Is #XSL code? -> You know my answer to this one. Is English not a language because lots of people speak it?

sympmarc @nickhadlee Is Druidism not a religion because it contains little spiritual duality?

sympmarc @nickhadlee Ok, that’s enough for me. Goodnight, Gracie.

For me Jim’s post pretty clearly sums up why XSL is indeed code. Based on Raymond’s response I think we both now admit our initial NOs were really a bit premature! If you’re still reading then I do congratulate you on persistence…now would be a good time to pull out some high-school-essay-style argument backed up with evidence. Not quite yet – I am quickly going to mention that there were other RTs (that’s a retweet for the twitter uninitiated. Twitter…what you mean that twitter-the-complete waste of time social-media-thing-ma-bob? No I don’t mean that. I mean twitter-the-extended-SharePoint-community-reach-out-tool. Sorry got a little preachy there!). One that I think is worth a mention was from Mark Miller (@EUSP) over at Why? Because if you work in the “no code” world then please check out the site as its one of the better resources for that kind of stuff:

EUSP RT @sympmarc @dullroar: @nickhadlee @iwkid @sympmarc -> Is XSL code? <- Critical discussion for EUSP authors.

Ok so I think I need to wrap this baby up so here is where I stand on the matter.

Do we need a label like “no code” or “codeless”? Does this all really matter or is it just semantics? No I don’t think it matters, not really. It seems easier to brand something ”no code” to make it easier to sell the idea to people that we are using the SharePoint platform more extensively instead of needing to deploy some heavy code-based customisations (By the way I like code – I even write some occasionally!). Are “no code” solutions any less risky or a lower impact option than deployed DLLs?…..NO! That would be a massive half-truth/un-truth/fallacy/plain-old-lie. I have seen Data Views, JavaScript and other “codeless” options bring pages and sites to their knees just as well as any dodgy code can.

Answer the question Nick! Is XSL code? I’d have to say (now) yes it is, thanks again Jim! Do we need a name for this so called “codeless” middle tier? Hmm, probably not but the debate will rage on for a bit yet…bet you a fiver! I think Marc Anderson said it best (not exactly like this but close enough).

“Does it really matter how we get to the solution? It’s satisfying the business requirement that matters most!”

Now I think I have come to the end of my diatribe. I’m not sure if I went anywhere but I at least feel I spent as much time as Jim and Raymond on a response. It has made me think I need to do a post on why I prefer using “codeless” techniques whenever possible but that is definitely a post for another time. Feel free to hit me up on twitter or leave a comment if you find any of this contentious/a further pollution of the internet or whatever. It’s really just the ramblings of a confused and simple mind!

The Content Type Is In Use – SharePoint 2010 Error Redux
May 24, 2010, 12:30 pm
Filed under: 2010, Errors, Tips & Tricks

This is a common error if you try to delete a content type in SharePoint. SharePoint is quite rightly trying to stop you from breaking anything by removing a content type if:

  • the content type is being used by a list or library somewhere in your site; or
  • another content type inherits from the content type you are trying to delete

SharePoint provides the SPContentTypeUsages class which allows you to track where the content type is being used and there are some good posts about other things to look for when tracking down the offending content type. In SharePoint 2010 there is an extra place you need to look…the recycle bin.

It seems SharePoint 2010 throws this error if you have assigned the content type to a list or library and it has been deleted to the recycle bin. I’m not sure why, and in this circumstance SPContentTypeUsages is no good to you – it won’t have any references about lists in the recycle bin.

Just remember next time you get this error to check the recycle bin and delete any lists or libraries that reference the content type.

Side Note – SharePoint Manager

A really easy way to get access to the information provided by SPContentTypeUsages is via SharePoint Manager.

SPM 2010

This is what you will see if a list referencing the content type is in the recycle bin…nothing!

Content Type In Use

5 Reasons to Attend the 2010 New Zealand SharePoint Conference
May 8, 2010, 1:48 am
Filed under: 2010, NZSPC, SharePoint

Ok so does anyone really need any reasons to attend a conference, let alone a SharePoint conference? Probably not…but maybe, just maybe, you need a little ammo to justify getting your manager, your wife/husband/partner/significant other/whoever to let you come along.

So in Letterman-like fashion heeeere’s tonight’s top 5 reasons to attend the 2010 New Zealand SharePoint Conference:

NZ SharePoint Conference

1. SharePoint 2010

The NZ Conference is on June the 9th and 10th (less than 5 weeks away) and SharePoint 2010 gets its public launch on May 12th. That’s only about 30 days between the launch and the conference. How many other SharePoint Conferences are going to be so close to the launch date? What better place to come and learn about SharePoint 2010?

2. SharePoint 2007

SharePoint 2010 is getting a lot of attention at the moment but this conference isn’t all about SharePoint 2010! There is still going to be a lot of 2007 focused content so if you want to hear about SharePoint 2007, maybe listen to what great things people have done with it, talk to people who have worked with 2007 for the last couple of years then “this will be the New Zealand conference to learn about SharePoint 2007”.

3. World Class Speakers

This year’s speaker line-up is really impressive!

There is a mix of international and local speakers which includes a number of MVP’s, a Certified Master, not to mention a whole other range of fantastic speakers from diverse backgrounds. The internationally renowned SharePoint experts are making fairly lengthy trips to get here and share their knowledge and there is some great home grown talent too so come and listen to what they have to say. I bet you learn a thing or two!

<Plug> Gary Payne and myself will be giving the session 2007 and 2010 Head to Head in the Real World to compare building a solution using 2010 vs. 2007. If you want to see what has changed, been made easier, or just want to see two SharePoint solutions built in under 50 minutes then come and see our session!</Plug>

4. It’s THE New Zealand SharePoint Event of the Year

Unlike other technology-focused conferences (such as TechEd) this will be about SharePoint, SharePoint and more SharePoint. If you want to know anything about SharePoint (2007 or 2010) and you’re in New Zealand between June 9-10 then this is the place you should be.

The session content will range from beginner (100 level) to deep-dive (300 level) in either Business, Technical, Vendor and Voice of the Customer streams. Whether you’re an IT pro, developer, consultant, business analyst, decision maker or end-user, there WILL be something at this conference for you.

5. It’s a Conference!

This is a two day event. Its a great way to get away from the office – of course the primary focus is on the sessions but conferences are sooo much more than sessions. SharePoint conferences are a fantastic way to network with other SharePoint people, maybe meet some of those individuals you interact with online, and there is more than likely going to be at least one world famous SharePint happening too.

So if you haven’t already it is high time to go get your conference ticket before they sell out!

Check out the online interest around the NZ conference on twitter and if you’re at the conference come and find me and say hello. I’ll be at the User Group Community booth, delivering a session and generally wandering around chatting to people.

New Zealand SharePoint Conference
February 22, 2010, 8:50 pm
Filed under: 2010, SharePoint

If you’re in New Zealand and work with, use or just want to hear about SharePoint then I recommend heading along to this years Community SharePoint Conference. If it is a good as last years then this will be a great event for New Zealand SharePoint people!

New Zealand SharePoint Community Conference 2010

%d bloggers like this: