locked
Updating Actuals on a Timesheet using PSI RRS feed

  • Question

  • Hi,

    I am working on importing project data (project, tasks, timesheets) from a legacy system to Project Server 2010 using the PSI interface. I have successfully written code to import a) Projects b) Tasks c) Timesheets. When the timesheets are created for a resource for a specific period the corresponding (Tasks from Projects) Timesheet Lines and corresponding Actual Lines are created. I am using the PreloadType.ProjectsAndAssignments in the CreateTimesheet API.

    The issue is that when I am trying to update the TS_ACT_VALUE using PSI changes are not taking effect. I am using the TimesheetSvc and the method is QueueUpdateTimesheet. 

    Thanks in advance.

    Naveed

    Monday, December 19, 2011 7:42 AM

Answers

  • The issue is resolved using the Statusing Service using the method UpdateStatus. I built the ChangeXml using this link.

    Naveed


    Regards, Naveed Saqib
    • Marked as answer by Naveed Saqib Tuesday, December 27, 2011 5:31 AM
    Tuesday, December 27, 2011 5:30 AM

All replies

  • Hi Naveed:

    When you made your update did you check out the project?  You will need to check out the project.  Make your update.  Then use the QueueUpdate Timesheet.  Then you have to publish the project.  ( I missed this step when I tried to make an update changes using psi call) And then check the project back in. 

    kkmick 

     

    Monday, December 19, 2011 3:50 PM
  • Hi kkmick,

    Thanks for the reply. I applied your suggestion but it did not work. How does it happen from the UI? The project does not even have to be checked-out. Since every user will enter their actuals using Timesheet.

    Naveed


    Regards, Naveed Saqib
    Wednesday, December 21, 2011 1:32 PM
  • I assume that you refer to the TS_ACT_VALUE on one of the ActuasRows that are present in the timesheet. Are the other fields of that row also set? Furthermore you have only updated the timesheet, not yet submitted. But even once submitted, the timesheets need to be approved before they show up in the project. Thus I wonder where are you stuk?
    Jan Cirpka
    Thursday, December 22, 2011 11:53 AM
  • Hi Jan,

    You are right about the field. TS_ACT_VALUE is the column I am trying to update. Interestingly the comment column is being updated. I agree with the complete cycle you have described but I am not expecting the Project Schedule to be updated but only the timesheet to be saved.

    It is happening with the UI. 1) Update approvals and Save 2) Submit Timesheet 3) Approve 4) Sync Project and the plan is updated.

    Please also note that this is happening only with Timesheet Lines that are linked with the Project / Task. If that is not the case I can update Actuals.

    Naveed


    Regards, Naveed Saqib
    Thursday, December 22, 2011 3:24 PM
  • Do you get any queue errors? Did you take a look at http://social.technet.microsoft.com/Forums/en/project2010custprog/thread/1e44bb78-e0e0-46c4-9858-6102379da83e? How does your code look like?


    Jan Cirpka
    Thursday, December 22, 2011 6:33 PM
  • Hi Jan,

    I did not get any queue errors. Yes I have seen the post you have mentioned it is quiet elementary. Following is a glimpse of my code.

    1. I have an Excel workbook with three sheets Projects, Tasks and TimeSheets.
    2. I am reading the file using OLE DB Adapter.
    3. Read projects and create them using the SvcProject of PSI.
    4. Create custom field in the project.
    5. Read tasks for the current project and create them. Also creating assignments for the pre-loaded resources.
    6. Then is turn for timesheets. For the current resource and period (pre-loaded) I create TimeSheet using the function 'CreateTimesheet' from the SvcTimesheet. It successes but when I try to modify the actual in 'Actuals' collection changes are not taking effect.

    Code is quiet long I can share a copy if you like.

    Naveed 


    Regards, Naveed Saqib
    Saturday, December 24, 2011 2:29 PM
  • The issue is resolved using the Statusing Service using the method UpdateStatus. I built the ChangeXml using this link.

    Naveed


    Regards, Naveed Saqib
    • Marked as answer by Naveed Saqib Tuesday, December 27, 2011 5:31 AM
    Tuesday, December 27, 2011 5:30 AM
  • Hi Naveed, doing this way didn't change the  MSP_TIMESHEET_ACTUALS.TS_ACT_VALUE.  How did you get the Actual Timesheet hours to show up?

    Todd Klost

    Tuesday, March 19, 2013 9:27 PM
  • Hi Naveed, Actually Todd Klost is right...i have faced the same issue..i need to apply as u are the timesheet actuals update through an outside application..i have applied the Statusing method using Changexml and have sent it to the Update method..what is happening is that Timesheet planned hours are being updated instead of actual hours, and MyTasks actual hours are updated correctly, which is not what j need actually because i want them automatically updated in timesheet. Any feedback?? How did u achieve this successfully?
    Monday, April 29, 2013 5:30 PM
  • Try to use FluentPS library, PSTimesheetService, UpdateTimesheet method in particular. It contains a lot of small pieces which are very important to make the update done.

    Andrew

    Tuesday, April 30, 2013 10:12 AM