I have been on a greenfield SharePoint project for the last few months that has really given me first hand exposure to some of the frustrations with SharePoint. One of those I will talk about today: The Content Organizer.
For those that do not know,the Content Organizer is a fantastic idea: You upload a document to a central document library, select the content type for that document, enter in some metadata and the document is magically routed to the correct place, even creating a folder if you set it up to do so. Seems pretty good , yeah?
Well, it is. It is absolutely fantastic, and was the perfect solution to one of our requirements. However, digging a little deeper, you very soon come across a major (to me anyway) limitation in the implementation of this: if you use a Lookup column for folder generation, it will generate a folder that looks something like this:
Not very nice is it? It turns out that this is another of those fantastically annoying features in SharePoint. You know that ones. The ones that make the entire platform look like amateur hour, particularly since you are paying a lot of money for the licence.
So, how to overcome this? Well, it turns out that you can create your own Content Router, though the examples are less than clear, and in fact, actually very wrong in some very important respects.
So here goes.
We have a set of documents that have the following set of Metadata:
|Function||Used to determine which Document Library to route the document to. In this implementation, we will have 3 Document Libraries.|
|Department||This will contain the departments that are associated with the function. This is used to create the folder.|
|Areas||The Area that the Function + Department belong to.|
|Document Types||The type of document that is being uploaded.|
During data entry for the documents, we wanted to be able to have the fields “cascade”. The only solution that we could come up with was to use the SPServices Cascade functions. For this to work required that the above fields be Lookup fields to a List on the site.
High Level Steps
The following were the high level steps that were taken to implement this functionality. These steps are expanded on in this post
- Create the Lists and the Data
- Create the Site Columns
- Create the Content Type and associate the columns
- Activate the Content Organizer on the Site
- Associate the Content Type with the Drop Off Library
- Create the Target Document Libraries and associate the content type with them
- Setup the Content Organizer
- Create the Content Organizer Rules
- Create the Custom Content Router
- Deploy the Custom Content Router to the Farm and Activate in the Web
- Change the Content Organizer Timer Job to run more frequently if required