none
Project Server 2013 TRUE Orphaned timesheets - how to delete RRS feed

  • Question

  • In testing projects the other admins did the following:

    1)  Create new project off template and publish, including site creation

    2)  Create time sheets, fill them out, status/approve them

    3)  Then they delete the project BUT not the timesheet data before the project is deleted

    This results in many orphaned records accumulating

    What is the best way to remove these bogus records?

    I see there are four tables involved with timesheets so does MS have a query that you can pass projectUID to remove the bogus timesheet data?

    Kind Regards,

    Timothy Atwood

    Wednesday, February 1, 2017 10:26 PM

All replies

  • Hi Timothy,

    Unfortunately, in the "delete enterprise objects" in the server settings, the timesheet deletion option only allows delete all timesheets on a given period, but not by users. The easiest way would be to delete them one by one from the "manage timesheets" menu in the server settings, eventually using delegation sessions. Or you can do it programmatically.


    Hope this helps,


    Guillaume Rouyre, MBA, MVP, P-Seller

    Thursday, February 2, 2017 3:43 PM
    Moderator
  • I am looking more for a solution with something like this that Barbara posted in another forum

    • DELETE MSP_TIMESHEET_ACTUALs where ts_line_UID 
       IN (SELECT DISTINCT  A.TS_LINE_UID
      		FROM MSP_TIMESHEET_ACTIONS  A 
      		INNER JOIN MSP_TIMESHEET_LINES L ON A.TS_LINE_UID  = L.TS_LINE_UID 
      			WHERE A.TS_ACTION_ENUM= 1 
      			AND L.PROJ_UID= '<complete UID>')
      
      delete  MSP_TIMESHEET_LINES where ts_line_UID 
       IN (SELECT DISTINCT A.TS_LINE_UID
      	FROM MSP_TIMESHEET_ACTIONS A
      	INNER JOIN MSP_TIMESHEET_LINES L ON A.TS_LINE_UID  = L.TS_LINE_UID 
      		WHERE A.TS_ACTION_ENUM= 1 
      		AND L.PROJ_UID= '<complete UID>')

      We have other reasons for why there are about 20,000 bad timesheet records and I am not sure we can even delegate to those users anymore due to the large number of inactive users now due to layoffs

    Timothy Atwood


    Thursday, February 2, 2017 6:57 PM