Archive for August, 2007

Don’t rename the title field in sharepoint lists and doing caml lookup by id

August 8, 2007

I guess alot of you that if you rename the Title field in a SharePoint list, the internal name is still “Title” (only the viewable name is actually changed). I had such a scenario where another developer had renamed the Title field to E-mail because there was really no need for having a title field in the list.

By itself this posed no problem, but when you work intensive with CAML problems quickly add up. When writing CAML queries in SharePoint you query on the internal name of the field. This didn’t pose as a problem for me, I just made a comment in the code so my fellow developers could see why I’d written “Title” in my query when the “E-mail” was what I needed. After I then ran my code nothing happend. SharePoint just returns “0 found posts” if anything is wrong with the CAML query making it hard to really see where the error is.

Somewhat confused by this, I downloaded the Stramit SharePoint Caml Viewer. Great application. When looking at the data for the entire list, I could see another field called “LinkTitle”. When I used this in my query it magically worked.

While I found a solution, I was really too far out in the internal fields of SharePoint, so I deleted the list and created a new one WITH THE TITLE FIELD :). I’m not sure if this oddity was caused by all the renaming but the lesson learned (at least for me) was: Don’t mess with the title field…

If you’re still reading, a quick tip for working with lookup fields in CAML. A normal caml query with lookup looks like:

<Where><Eq><FieldRef Name=”Category” /><Value Type=”Lookup”>My category</Value></Eq></Where>

Nothing fancy here, but something that I’ve only found on a few blogs out there is how to do the lookup with the item id. Here’s how:

<Where><Eq><FieldRef Name=”Category” LookupId=”TRUE” /><Value Type=”Lookup”>234</Value></Eq></Where>

Happy SharePointing πŸ™‚

VM-ware Fusion and remote desktop fun

August 7, 2007

While I’ve been using apple computers for years now, I’m new to virtualization.

Because we develop web applications using Ruby on Rails, we decided to work with apple MacBooks. This is really nice because we then look cool while writing cool code, but a challenge when we do consultancy work on other platforms. Currently I’m doing Sharepoint (MOSS 2007) development for a customer and for this MacOS just won’t cut it. For this we’ve bought VMware Fusion. I cannot praise this magnificent piece of software enough. It just works (and I’m still running with the beta version).

So a couple of days ago I had to connect via remote desktop to my MOSS development environment and change my default password. To change my password on the Windows 2003 server I had to do a “ctrl-alt-delete“, and then it hit me… How the heck do I do this with my MacBook keyboard?! I’ve started a Windows XP in VMware Fusion and connected to a (virtual) Windows 2003 Server through Remote Desktop (talk about virtualization :)). I search the net but could not really find anything about this cocktail, so I wanted to share my findings on this tricky key combination (or at least store it somewhere for when I need it again in six months):

fn-M + numeric enter (the funny up arrow next to the right apple key) + <– (the top right delete key)

I used like an hour to figure this one out πŸ™‚


Design a site like this with WordPress.com
Get started