Search code examples
sharepointmoss

SharePoint column default values - add 10 working days


In SharePoint MOSS 2007, I have created a custom content type that I will be applying to a document library. One of the required fields is "Incoming Date" and another is the "Due Date".

The Due Date is always 10 working days from the Incoming Date. The Incoming Date is when the mail room received the letter, not necessarily when the document is posted to the library.

From here: http://msdn.microsoft.com/en-us/library/bb862071.aspx

=DATE(YEAR([Incoming Date]),MONTH([Incoming Date]),DAY([Incoming Date])+10)

adds 10 days, but how can I add 10 working days? I don't have the luxury of VS.NET either per the governance plan of our sharepoint rollout.

Assume a human is responsible for the data entry, but I would like to make it easier for them.


Solution

  • Firstly I should point out that you are making hard work of that formula, this will do the same.

    =[Incoming Date] + 10

    From the comments you have figured out that 10 working days (M-F) will always have 2 weekends so you can use this

    =[Incoming Date] + 14

    But this still doesn't take account of holidays

    You are not going to be able to do this without some custom code in a workflow or possibly some javascript 'hack' and a database of holiday days for your region.

    One possibility would be to default your Due Date to 10 working days from now when the record is created

    =Today+14

    and then rely on your users to manual alter this date if there are holidays in that period.

    More details on this in a blog entry I've just written - Working Days, Weekends and Holidays in SharePoint Calculated Columns