Add “Link to a Document” Content Type to the Default Content in a Document Set in SharePoint 2010


The Document Set feature in SharePoint 2010 is a great addition to the document management functionality of the platform. Today we used the document set to make it able to prefill a folder with a predefined set of documents. One document which should be added as default content is the “Link to a Document” contenttype. Which is a difficult one because you don’t have a template file like a docx or xsls. After some try and error I found a solution to template the Link to a Document page.

· Create a Link to a Document or other content type with Link to a Document as parten in a document library

· Use a dummy url for the Document URL and click OK

· Open the site with SharePoint Designer, Select all files

· Select the Link to Document you created in the Document library and choose export in the context menu

· Go back to the SharePoint Site and navigate to Site Content Types

· Open the Document Set where you want to add the default content and open Document Set settings

· Select the Link to a Document content type and choose browse to select the saved file and upload it

· Now you are able to use the Link to a Document content type to add as default content!

Notes:

– You can also use this trick to set the template as the template for the content type, instead of the default /_layouts/CreatePage.aspx

Default Custom View for Document Set in SharePoint 2010


When working on a Document Management Solutions with Document Sets I had a struggle to find out how to select a custom view to use within a Document Set. After my search I would like to share this information with you. The next steps will help you to accomplish this.

· Go the the document library settings

· Define a new view for the document set on the document library

· Define your view and optionally choose where you are able to select this view

· Click on OK

· Click on the Document Set Content Type

· Click on Document Set Settings

· At the end of the screen you will find a drop down list under “Welcome page view” where you can select default view

Somehow the procedure makes sense, but you have to know it.

Hiding menu items in SharePoint 2010 Ribbon


A lot of customers are excited by the big bag of features SharePoint offers by default. But they don’t want to bother all users with this functionality. The SharePoint team did a great job by security trimming the SiteAction menu but made another design decision for the SharePoint 2010 Ribbon. Instead of removing unauthorized features they are greyed out.

SharePoint 2010 standard ribbon

SharePoint 2010 trimmed ribbon

Tobias Lekman did a great job by writing some nice (jquery) script to hide accomplish this task. The full article can be found here

Reference:

http://blog.lekman.com/2011/05/hiding-inactive-ribbon-commands-in.html

Use the calculated field to show weeknumber in SharePoint 2010


A common issue I’ve encountered is how to use the week number of a date in SharePoint. The most common use of the week number within SharePoint is to filter views or grouping of information based on the current date. Also today we were struggling again with some weeknumber code for SharePoint which was not returning the valid weeks for the standard used in the Netherlands.

In Europe week 1 starts on the Monday of the week in which 4th January falls. In other words, week 1 starts on the Monday of the week that contains the first Thursday of the year. This can be represented by the following formula:


=INT(([datecolumn]-DATE(YEAR([datecolumn]-WEEKDAY([datecolumn]-1)+4);1;3)+

WEEKDAY(DATE(YEAR([datecolumn]-WEEKDAY(datecolumn-1)+4);1;3))+5)/7)

Which is something like

  • Calculate the distance between the beginning of the year (with regard of the start of week 1) to the datecolumn
  • Add the day of the week of the 1st January of the datecolumn year added with 5 (Thursday)
  • Divide by number of days in a week (usually 7 😉
  • Floor by doing a cast to INT

When week 1 starts in the week of the 1st January (USA Standards) you can use the following code.


=INT(([datecolumn]-DATE(YEAR([datecolumn]),1,1)+

(TEXT(WEEKDAY(DATE(YEAR([datecolumn]),1,1)),"d")))/7)+1

Which is something like

  • Calculate the distance between the beginning of the year to the datecolumn
  • Add day of the week of the 1st January of the datecolumn year
  • Add divide by number of days in a week (usually 7 😉
  • Cast to integer (is Floor)
  • Add one day

Beside the use of the weeknumber based on a date column, you probably want to use the current date within your formula. To use the [Today] variable in a calculated column you need to use the following workaround. Without using this workaround you will get the error that you can’t use variables like Today and Me in a calculated column.

  • Add a column named Today to the list where you want to use the variable
  • Add a calculated column with the weeknumber calculation using the Today value (which will initially be the column value of Today)
  • Remove the column named Today

Every time you want to change the calculated column you need to repeat the steps in the same order. Good luck!