locked
Calculate working days between dates using PSI RRS feed

  • Question

  • I am trying to create a web app that sets the Start Date and Finish Date for each task.  I know that is not usually how Microsoft Project works.  I am familiar with the constraints, however am trying to create a simpler app.  To do this, I will need to set the Must Start On constraint, and the duration.  I want to calculate the duration, based on the selected finish date in the app.  To calculate it, I need to determine how many working days (or more specifically duration units) there are between two days.  Would I get that information by using the Calendar web service, or the Resource web service, or some combination of both, or some other crafty means?  In client VBA I could probably have used ProjDateDiff to calculate this.

    I am using Microsoft Project Server 2007 web services, by the way.

    Monday, November 15, 2010 9:59 PM

Answers

  • The Calendar methods in the PSI support calendar exceptions, not all enterprise calendar functionality. See, for example, the ReadCalendars method. If you find which calendar a project uses (with Project.ReadProject), and which calendar an assigned resource uses, you could use the Calendar.ReadCalendars and the Resource.ReadResources methods to find all of the relevant calendar exceptions, assume a standard work week, and then calculate the finish date.

    The problem comes with work weeks, which the PSI does not return. Doesn't sound very simple to me, and would not work if your work week assumption is wrong. The PSI was not designed to replace the scheduling done by Project Professional 2007.

    --Jim


    Jim Corbin [MSFT]
    • Proposed as answer by Jim Corbin Tuesday, November 16, 2010 5:15 AM
    • Marked as answer by Alexander.Burton Saturday, March 26, 2011 7:17 AM
    Tuesday, November 16, 2010 5:14 AM