Wednesday, June 24, 2009

Error message when checking in a document from office 2003

In a custom solution I recently worked on we were receiving an error from office applications when we tried to check in documents from within office 2003 applications like word or excel. The error was: "Cannont perform this operation. The file is no longer checked out or has been deleted" After a lot of digging, I found that the fault was in the custom content types that we deployed as features. The problem was that the person who wrote the CAML for the content types that inherit from the "Document" content type thought (understandably so) that it is enough to specify only the fields that the custom content type adds on top of the built in column. This meant that the content type did not have the right columns for file name for example. This was ok in the web UI or in office 2007 - but office 2003 must have some hard coded references that it missed, and it kept throwing errors. The solution was simple - add a reference to the built-in columns in each content type - even if it does inherit from the document content type. The following are the columns I had to add to solve the issue:

<!-- out of the box document columns--> <fieldref id="{5f47e085-2150-41dc-b661-442f3027f552}" name="SelectFilename"> <fieldref id="{8553196d-ec8d-4564-9861-3dbe931050c8}" name="FileLeafRef" required="TRUE"> <fieldref id="{8c06beca-0777-48f7-91c7-6da68bc07b69}" name="Created" hidden="TRUE"> <fieldref id="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" name="Title" required="FALSE" showinnewform="FALSE" showineditform="TRUE"> <fieldref id="{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}" name="Modified" hidden="TRUE"> <fieldref id="{822c78e3-1ea9-4943-b449-57863ad33ca9}" name="Modified_x0020_By" hidden="FALSE"> <fieldref id="{4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb}" name="Created_x0020_By" hidden="FALSE">

So that solved it for the content types - if I added those content types to document libraries, there was no more issue of checking documents from office 2003. However, if you are adding the content types to the document library using either a feature (elements file with ContentTypeBinding) or using schema.xml, an incorrect character or binding in the xml files may also trigger the same issue. so beware!

Using the Today token in a CAML query

I just noticed today that the CAML creator application that I am using (by U2U) does not handle the today token properly (at least the version I have).
The Today token is used in views, when you want to filter on a date based on the current date. For example, if you want to set up a view that shows future events you set the filter on start date > "[Today]".

However, in CAML, you cannot use "[Today]" - the square brackets cause the query to break. Instead, you use "<Today />".
For example:
<Where><Geq><FieldRef Name='EventDate' /><Value Type='DateTime'><Today /></Value></Geq></Where>

Tuesday, June 02, 2009

Read bits of my book in google

I just discovered that Google has bits of my sharepoint book that you can see for free- including the section on keyboard shortcuts (which I think is useful to print and put on the wall). Take a look (and feel free to write a review either there in google or here in the comments). The link is http://books.google.com.au/books?id=aJa4sjrHVLkC

Sunday, May 31, 2009

Easy links to remember for asking sharepoint questions

I hope this will be useful for someone - I made two tinyurls to help me (and others) remember the links to the sharepoint discussion forums in msdn. this way, all you have to remember is tinyurl.com and the text that I added:

SharePoint Products and Technologies Forums home page:
http://tinyurl.com/SharePointForums

SharePoint general questions forum:
http://tinyurl.com/SharePointForum

SharePoint development forum:
http://tinyurl.com/SharePointDevForum

SharePoint How To Book is published and in print

Hi everyone. This is to let you know that my book - SharePoint 2007 How-To is now available for purchase as either paperback or pdf or for kindle or sony reader or whatever format you want.

This book is probably not for the regular reader of my blog, since this blog deals with development issues, and the book is targeting end users - so if you are a developer or a sharepoint administrator, you may want to consider this book as the end user training tool for your users. Teach them how to use sharepoint.

When writing the book I had a target in mind - I did not set out to write the difinitive sharepoint guide. The book does not have everything about sharepoint. Instead, it helps the user with the most common tasks that an end user just has to know to be able to use a sharepoint site. So, while there is much more to learn beyond the book, I feel the book gives the reader a good basis to start the learning - without being a heavy, forbidding book that is hard to read (or indeed lift).
I am very interested if anyone who read the book can let me know if they think I achieved that goal. Please, if you have read it - can you leave constructive feedback either here (comment on this post) or in the book's page in Amazon (under "Customer Reviews").

Just so you get a feel what is in the book before you consider buying it (Amazon will let you read parts of it if you want), here is the table of contents:
Part I, "Solutions for Readers", has the most common and basic tasks that do not involve changing anything in SharePoint, but just viewing, browsing, and finding information. This part includes:
Chapter 1, “About Microsoft SharePoint 2007”
Chapter 2, “Finding Your Way Around a SharePoint Site”
Chapter 3, “Solutions Regarding Files, Documents, List Items, and Forms”
Chapter 4, “Searching in SharePoint”
Chapter 5, “Personal Sites and Personal Details (Available Only in MOSS)”


Part II, “Solutions for Authors and Content Managers”, teaches you how to perform tasks that involve adding content to SharePoint or changing the way it looks. This part includes:
Chapter 6, “Creating and Managing Files, List Items, and Forms in SharePoint”
Chapter 7, “Creating Lists and Document Libraries”
Chapter 8, “Creating List Views”
Chapter 9, “Authoring Pages”
Chapter 10, “Managing Security”
Chapter 11, “Workflows”


Part III, “Solutions for Site Managers,” has advanced tasks involved in creating andcustomizing SharePoint sites. This part includes:
Chapter 12, “Creating Subsites”
Chapter 13, “Customizing a SharePoint Site”
Chapter 14, “Managing Site Security”


Finally, I list Common Keyboard Shortcuts for sharepoint (which may surprise you) and useful links to pages that every sharepoint site has (for example- how to get to the "Site content and structure" page or to the page that shows the list of last content you edited... again - this may surprise even the expirienced user.

So what do you think? useful? useless? are you going to buy this? do you need this for end user training? Should I change anything if I write another book for the next version of sharepoint? I'd love to hear what you have to say...

Monday, April 20, 2009

Access denied in win2008 with a custom host header

As usual - I failed to write this down when it happened before, and every time I encounter this issue I fail to remember how to solve it.
The issue - you install a new sharepoint machine and create a web application with a custom host header and then try to browse to it from the server itself using the host header (which is correctly configured in the DNS and host files and all) and you get prompted for a username\password three times and then get thrown out.
This happened with sharepoint 2003 as well, and with windows 2003 server and has the same reason behind it - a loopback check on the server. In 2008 however it threw me several times when I created a web application, and browsed to it and it worked and then I had to recreate it and it suddenly stopped working from the server, while other machines could browse to it with no issues. arrrggghhh!

So, if you have a web application with a custom host header, and if you browse to it from a client machine you can view the sites, but from the server you get prompted for password and nothing you enter works...try the solutions described in this KB article (KB896861). I know the title refers only to IIS 6, and I know the article mentions windows XP and windows 2003 - trust me, it solves this issue for windows 2008 just as well.

Tuesday, March 10, 2009

Fix for the infrastructure update picture library bug

If like me you find the infrastructure update ruined your picture library views, check out this hot fix that microsoft released

Wednesday, February 25, 2009

Finally - a solution to having bluetooth in windows 2008

As you know, I run windows 2008 on my laptop - to take advantage of hyper-v, and to be able to develop and demo sharepoint FAST.
The only problem I had so far was the bluetooth - which I solved in past installations, and then something broke and I couldnt get it to work again. Well - if you have the same problem as me, here is the solution that solved my issues: http://www.dev-toast.com/2007/01/05/uncrippling-bluetooth-in-vista-rtm

Monday, February 09, 2009

Preventing IIS from logging activity on a specific sharepoint site

A friend at "Kraft Foods" sent me the following tip to share with you. I must say that I didn't try it myself - so use at your own risk.

The problem
IIS logs activity for a sharepoint web application, for all sites. If you have a web application with a lot of sites, and a lot of activity, the IIS logs may grow out of proportion and make analysis of the logs harder and harder. What if you don't want it to audit all sites, but just some of them? what if we want to exclude a certain site that is hit often, and we don't care if it is audited by IIS?

Well, if our site was a regular .net site, we would have the folders of that site (the virtual directories) shown and we could mark places in the hierarchy that we do not want to audit. But SharePoint does not create virtual folders in IIS, instead IIS has only one folder for all site collections in the web application.

The solution
According to my friend, the solution is to manually create folders under the IIS physical folder by the url names of the sites that you want to exclude. For example, if you have a site called "News" that you want to exclude from the logs, go to "C:\inetpub\wwwroot\wss\VirtualDirectories\{your web application}" and create a folder "News". Then, in IIS right click the folder, and configure it to be excluded from the logs.

More Info
I couldnt find how to exclude the folder in windows 2008 - but in IIS6 you can do that under "Directories" tab, by setting "Log Visits" = unchecked.

Sunday, February 08, 2009

New MOSS internet site launched - good case study

One of the three Israeli mobile communication companies has released a new web site – using MOSS. From my initial review, it is one of the best implementations I have seen so far in that it:

  1. Works (I couldn’t find a page with errors or place holder text which is usual in new sites)
  2. works reasonably fast
  3. usable – nice big global navigation, in sub sites there is a nice distinct secondary navigation
  4. different sections have different backgrounds – so the shop pages look different from the customer relations pages
  5. makes use of personalisation – users can log on, see their account and special offers
  6. even search looks good and is optimised with keywords and best bets – although they could have used a different font for the description to make it different from the link)
  7. system pages are properly disabled – showing a user friendly error message
  8. same for page not found error
The site (which is in Hebrew) can be found under http://www.cellcom.co.il

Does anyone know who built the site for them? kudos!