Project Server Timesheets: What happens when I delete a project or assignment?

Take 2 – just in case you thought you saw this post coming earlier…

I’ve had a few questions recently around the behavior of timesheets in Project Server 2010 and 2013 (and Project Online) when projects, tasks or assignments are deleted.  Some of this relates to bugs – other behavior is expected, and it is different if single entry mode is enabled.  Thanks to Shazeb Khan, Michael Wharton, Elli Johnston and Randy Slycord for some of the questions and answers that led to this posting – and skip to the And finally section at the bottom for a timesheet status bug we are looking to fix..

Firstly it is worth reviewing the article on TechNet Best practices for submitting and reporting on actual work, which, although written for 2010 is still applicable for Online and 2013.  That suggests using Single Entry Mode – but I will go on to explain what happens if it is enabled or not. 

First with Single Entry mode, and I’m looking specifically at Project Server 2013 – I’ll mention where 2010 differs from this behavior...  For this example I have just a couple of projects, three timesheets; one approved, one submitted and one saved.  Each has lines from each plan – then I delete one of the plans…

What happens next is a little like Schrödinger's cat – the lines in some of the timesheets are still there – as long as you don’t try to observe them (well not a perfect analogy as you can look in the database – but mentioning a cat in the blog must push this up the page ranking!).  In the database (reporting schema) we see that the Approved lines are still there (TimesheetLineStatus = 1), the pending lines are still pending (0) and one of the Pending Approval lines is now rejected (2) with a comment of  “The timesheet has been rejected because it contained at least one task from a project that has been deleted.”

Database view of the timesheet

If I look at the MSP_TimesheetActual table I still see all 30 rows (5 entries for each of the 2 plans for 3 weeks).  Now I’ll open my timesheet…

Remember I mentioned a bug?  Well here it is.  Clicking OK gives ‘An unknown error has occurred’.

View failure message

This will be fixed in the April 2014 Cumulative Update for Project Server 2013.  This will also cause an issue in the Approval Center – giving an error ‘One or more categories of approval could not be loaded’.  Thanks Michael Wharton for asking about this message – the term categories is not referring to anything like the Project Server categories – just being used generically.

I can recall my timesheet and then remove the Rejected line and resubmit.

Timesheet showing rejected task

For the timesheet that was just saved I currently see slightly different behavior between 2010 and 2013.  In 2013 I still see the line for my assignment to the deleted project.  And I can re-save – but if I submit my timesheet then I get an error.  This is also related to the April 2014 fix.

Error on webpage

In 2010 the database almost looks the same, but I did notice something I hadn’t seen before – and haven’t had a chance to check for any different settings – but I have 42 actual lines rather than 30 – I see line entries for the weekend – zero hours as I might expect – but these aren’t seen in 2013.  If I look at the timesheet that was saved and not submitted the assignment to the deleted project no longer shows, but it is not until I save that the line is removed from the database (this is the Schrödinger's cat part).  So if you are reporting on the timesheets you may still see lines for plans that have been deleted – if the user has not opened and saved the current timesheet after the plan was deleted.  The lines are still there – unless you look at them.  Even the pending approval lines can appear to disappear – as the change in status to rejected may also throw out your reports for lines that had not been approved – if you are using the TimesheetLineStatus field.  This was a conversation from the Project Conference with Elli Johnston as it appeared from reports that we were deleing lines – but it was just a change in status (and this was not single entry – so I’ll look at that next…).

The main difference in single entry mode (apart obviously that the submission of the timesheet does not send status updates) is how the deleted assignments are handled.  First 2010.  If I follow the same steps as above then instead of the timeline disappearing it get changed, and in place of the project name I see Personal Tasks. Again, not until I save this do I see any change in the database – which still shows the line as pending… 

Personal Task

Once I do save however, I will see the TimesheetLineStatus change to a 3 (Not Applicable).  This was the specific change that was occurring in Elli’s scenario making it look like line were disappearing from reports – but it was the status had changed.  If the timesheet has been submitted or approved then the project name is kept and the status stays good (1).

In 2013 currently the deleted assignment is still present in the timesheet and has a status of 4 (Pending Approval) – this feels like it is part of the bug mentioned above as I’d expect the same behavior as 2010 – I’ll review once I have the April CU loaded and update this posting.

And finally…

Another condition we have seen with timesheet status (not line status) in Project Server 2013, not related to deletion of projects, is that you can get the wrong timesheet status value in the reporting tables under certain conditions.  An approved timesheet should show the status of 3, but this is being reset to 0 when status is accepted against tasks in the timesheet.  It is a timing issue, and if the status update is processed before the timesheet approval then all is good – so this could be a workaround if you are hitting this problem.  This only happens in Single Entry Mode.  This doesn’t affect the display of the timesheet status in Manage Timesheets (which gets its status from the pub schema) – just reporting (coming from the dbo schema).  Thanks to Randy and the Sensei team for pointers on this one, and to Shazeb for suggesting the topic worth blogging.  This is in the queue for a hotfix but I don’t have a schedule yet.

Cats were neither harmed nor not harmed during the preparation of this blog post.


Comments (18)

  1. anonymouscommenter says:

    Brian: when you say, "It is a timing issue, and if the status update is processed before the timesheet approval then all is good," consider the popular case where everyone is their own timesheet approver. It’s impossible for these not to be incorrect.
    I can now attest to it.

  2. anonymouscommenter says:

    But what about the timesheet line status issue? I’d like to know if this is also on your bug fix radar. Detailed discussion on this can be found on this forum post:

  3. To Gary’s point – one option might be to send status first, then once you know the update has been accepted you can send final timesheet. I appreciate this is messy. I’ll also look into other options. One possible one that I know you are all thinking is
    just update the dbo schema tables with the correct values from the pub schema – and this might be one of those occasions when I’m ok with touching the DB… (Others may disagree). And to Elli’s point the line status getting changed to ‘Not applicable’ isn’t
    (yet) considered a bug, but certainly talking through with you and appreciating the effect it can have on reporting certainly makes me open to considering it a bug – but then I don’t get the final call on this one as far as fixing it (and the workaround of
    allowing for this scenario in your reports would be the push back – once you know it is happening). I’m interested to see how all this behaves with the April 2014 CU as far as 2013 is concerned – and that may impact the likelihood of any fix in this area.
    I hope than answers you question Elli – although I know it is a bit wooly. Brian.

  4. Also Elli – I am reviewing the forum thread – I think the post above only covers some specific scenarios that are throwing your report out, I’ll see what else I can find. Brian.

  5. anonymouscommenter says:

    Brian, in this case the report is not a trivial bi-product, but an essential management tool. If you run timesheets, you need to be able to monitor compliance, making this a high-impact issue.

  6. anonymouscommenter says:

    Has the bug noted in the “And finally” section been added to a hotfix yet?

  7. Hi Adrienne, this looks to be in the pipeline now for the June CU 2014 – due to ship 10th June.
    Best regards,

    1. Hi Brian, just to check on this one – I think there might be a typo on your comment but want to make sure. Is this CU due in June 2016? or was it due in June 2014?


      1. Hi Nico – As the post was made in 2014 – I would have been referring to 2014 (my predication capabilities don’t go out too far…) Strangely when I reviewed that posting it updated all of my comments with an edited date of today – which does now get confusing…
        Best regards,

  8. anonymouscommenter says:

    Thanks very much for your quick response, Brian!

  9. anonymouscommenter says:

    is the ‘One or more categories of approval could not be loaded’. error fixed in the April CU or is that still pending?

  10. Arun Saini says:

    Hi Brian Our client who are on Project Online have encontered same issue which you have mentioned as bug”The Timesheet has been rejected because it contains at least one task that has been deleted or rejected” Like to has this not been fixed.

    Along with this we also noticed another bug. When some one use delegare feature and create a timesheet but doess not save or submit. The entry of timesheet record does not get reflected in the TimesheetLines table but its there in the Timesheets table. Whenwe recall and resubmit issue gets resolved for this
    Regards Arun

    1. Thanks for the feedback Arun. Is your second point Online also? Is your analysis based on the OData output?
      Best regards,

    2. Joshua Moagi says:

      Hi Brian, thanks for this post. Just to follow up on this issue, has this been fixed with some CU. We using 2013 on-premise and are on April CU 2016 however still experiencing this issue.


      1. Sounds like it might be a new issue or a regression Joshua – we certainly fixed the original problem that I mention in the posting.
        Best regards,

        1. Joshua Moagi says:

          Thanks Brian, we shall observe and feedback.

        2. Scot Milroy says:

          Hi Brian,

          We have a client that is experiencing this issue. They are not using timesheets at all and get the same Error: One or more categories cannot be loaded when accessing the Approvals Center. The client is currently on the June 2016 PU. Has there been other issues identified by other clients? I am at a loss to resolve this. There are no Node Consistency Errors in the ULS logs so I’m at a loss as to how to fix this. Thanks. Scot

          1. Probably best to open an incident Scot – there can be variable reasons for this error and we’d probably need to dig deeper. Are there likely top be a high number of approvals waiting? I have certainly seen that be an issue. One quick fix for that can be a stored procedure modification to use ‘TOP 100’ rather than returning all rows – which can help the page load – and then work through all the outstanding approvals. Best to do this with our help on a support call.
            Best regards,

Skip to main content