none
PSI Webservice for Timesheet RRS feed

  • Question

  • Hi,

    i have been assigend a Task to update Timesheet's of a user from a Project's sharepoint site,I came to know that i can achieve this by PSI webservice

    how can i do this

    Thank You

    Friday, March 11, 2011 11:18 AM

Answers

  • Hi Pranay,

    There are several steps, which depend on how you want to update the timesheet data -- manually or programmatically; and by the timesheet owner or by someone else. You don't say whether you are using Project Server 2007 or 2010. If 2010, and you have not done a PSI application before, start with the Getting Started with Development for Project 2010 article -- particularly the Project Server Web Parts and Project Server Interface sections.

    By using Visual Studio 2010, you could create a Visual Web Part to add to a page on the project site (in Project Server 2007, that is the project workspace). The Web Part would call the ReadTimesheetList method or the ReadTimesheetByPeriod method to get data for the timesheet of interest, perhaps display the data in a grid (depending on how you want to update the data), update the data and call PrepareTimesheetLine, and then call the QueueUpdateTimesheet method. You may also need to add controls to the project site ribbon.

    Note the Project Server permissions required for each of the PSI methods you use. This would be a major job. It is worth examining the requirements, and checking whether the update could be done simply by adding a link to the My Timesheets page in PWA, which is designed for managing timesheets.


    Jim Corbin [MSFT]
    Friday, March 11, 2011 4:21 PM

All replies

  • Hi Pranay,

    There are several steps, which depend on how you want to update the timesheet data -- manually or programmatically; and by the timesheet owner or by someone else. You don't say whether you are using Project Server 2007 or 2010. If 2010, and you have not done a PSI application before, start with the Getting Started with Development for Project 2010 article -- particularly the Project Server Web Parts and Project Server Interface sections.

    By using Visual Studio 2010, you could create a Visual Web Part to add to a page on the project site (in Project Server 2007, that is the project workspace). The Web Part would call the ReadTimesheetList method or the ReadTimesheetByPeriod method to get data for the timesheet of interest, perhaps display the data in a grid (depending on how you want to update the data), update the data and call PrepareTimesheetLine, and then call the QueueUpdateTimesheet method. You may also need to add controls to the project site ribbon.

    Note the Project Server permissions required for each of the PSI methods you use. This would be a major job. It is worth examining the requirements, and checking whether the update could be done simply by adding a link to the My Timesheets page in PWA, which is designed for managing timesheets.


    Jim Corbin [MSFT]
    Friday, March 11, 2011 4:21 PM
  • Thanks for Your Reply  Jim Corbin,i will try it
    Monday, March 14, 2011 7:36 AM
  • Hi Jim

     

    I created a web part which adds non-project timesheet lines to timesheet, for adding lines I have a web service that uses PSI methods and I am calling it in a button_click action in my web part, everything works properly but I have a few problems after the lines are added:

    First, after adding lines although the QueueUpdateTimesheet method has called, they are not visible in the timesheet; therefore, it is necessary to save the timesheet again to see the newly added lines.

    second, if the user refreshes the page before saving the timesheet it seems that the web service runs again with the same input parameters, as a result it throws an exception with the error code 2008=GeneralObjectAlreadyExist; it is clear that it happens because the same lines are going to add again.

     

    Do you have any idea how to face these problems?

    Thanks

     

    Sunday, June 19, 2011 5:36 AM