none
Prevent a Task from being deleted or lock certain Tasks

    Question

  • Hello, I have requirement where there are certain Tasks in a Project 2010 project plan that we would like to lock down and prevent from a user deleting.  These tasks could be summary Tasks.

    The intent would be that in our project template we would identify all the tasks and lock them down, then users would populate their project plans based on this template.

    Could some one advise of a way to prevent deletion of certain tasks?

    thank you very much, mark


    Mark A. Eckert SharePoint Consultant Pharmica Consulting, Inc.

    Tuesday, April 10, 2012 5:15 PM

Answers

  • Hi Mark,

    Yes, that's the one. I know of no other. Project events do not have a Cancel statement, application events do.

    Greetings,

    Tuesday, April 10, 2012 7:37 PM
    Moderator
  • The only way to do  this would be to have some VBA code in Project Pro that would capture the Task delete event NOT allow the deletion if the task met certain criteria.

    Short of that you have to trust your project managers to leave certain tasks in place.


    Brian Kennemer - Project MVP
    DeltaBahn Senior Architect
    endlessly obsessing about Project Server…so that you don’t have to.
    Blog | Twitter | LinkedIn

    Tuesday, April 10, 2012 5:32 PM
    Moderator
  • Yes. That one should let you cancel.

    Let me know if you have any questions. It is not the most straightforward of events to setup but once you have done it once it is easy.

    The only real weak spot in this besides having to add these events to your global MPT file is that it will likely depend on a custom field for the criteria and that means that the users you already dont trust to not delete the tasks would now have to be trusted to not change the value of the field you use to make sure they cannot delete the tasks!!! :-) to be 100% certain you would need to also add code to the Application taskchange event to make sure that the field is not changing. That can get pretty heavy, in that it fires MANY times and even a small bit of code there can cause performance slow downs.

    Hopefully you will not feel you need to check that field. ;-)


    Brian Kennemer - Project MVP
    DeltaBahn Senior Architect
    endlessly obsessing about Project Server…so that you don’t have to.
    Blog | Twitter | LinkedIn

    • Marked as answer by Mark A. Eckert Wednesday, April 11, 2012 2:32 PM
    Tuesday, April 10, 2012 8:10 PM
    Moderator

All replies

  • The only way to do  this would be to have some VBA code in Project Pro that would capture the Task delete event NOT allow the deletion if the task met certain criteria.

    Short of that you have to trust your project managers to leave certain tasks in place.


    Brian Kennemer - Project MVP
    DeltaBahn Senior Architect
    endlessly obsessing about Project Server…so that you don’t have to.
    Blog | Twitter | LinkedIn

    Tuesday, April 10, 2012 5:32 PM
    Moderator
  • Hi Mark,

    As such there is no way to lock the tasks from deletion; this could be a process need that you need to make your users aware of.

    You can keep initial copy of the plan before giving it to users to populate with their other tasks, later on to identify the addition or deletion of tasks you can run the Version Comparison utility (Compare Project) built in the Project. Also, UID is unique field that gives a hint on deleted tasks. Say if there was a task with UID 4 that is deleted by a user in a project of 10 tasks, any new addition of tasks pick of next UID here 11 but not 4. So deleted tasks UID could be a way to find that some tasks are deleted; but UID can't give you other info about the deleted tasks.

    http://epmsource.com/2009/10/15/new-compare-projects-report-in-project-2010/


    Sapna S


    Tuesday, April 10, 2012 5:42 PM
    Moderator
  • Thank you both.

    Brian, just to clarify, are you suggesting Application level event for ProjectBeforeTaskDelete.  Or another means capturing the Task delete event? 

    thanks a lot, just want to ensure i am covering all my options.


    Mark A. Eckert SharePoint Consultant Pharmica Consulting, Inc.

    Tuesday, April 10, 2012 6:11 PM
  • Hi Mark,

    Yes, that's the one. I know of no other. Project events do not have a Cancel statement, application events do.

    Greetings,

    Tuesday, April 10, 2012 7:37 PM
    Moderator
  • Great, thanks everyone.

    Mark A. Eckert SharePoint Consultant Pharmica Consulting, Inc.

    Tuesday, April 10, 2012 7:49 PM
  • Yes. That one should let you cancel.

    Let me know if you have any questions. It is not the most straightforward of events to setup but once you have done it once it is easy.

    The only real weak spot in this besides having to add these events to your global MPT file is that it will likely depend on a custom field for the criteria and that means that the users you already dont trust to not delete the tasks would now have to be trusted to not change the value of the field you use to make sure they cannot delete the tasks!!! :-) to be 100% certain you would need to also add code to the Application taskchange event to make sure that the field is not changing. That can get pretty heavy, in that it fires MANY times and even a small bit of code there can cause performance slow downs.

    Hopefully you will not feel you need to check that field. ;-)


    Brian Kennemer - Project MVP
    DeltaBahn Senior Architect
    endlessly obsessing about Project Server…so that you don’t have to.
    Blog | Twitter | LinkedIn

    • Marked as answer by Mark A. Eckert Wednesday, April 11, 2012 2:32 PM
    Tuesday, April 10, 2012 8:10 PM
    Moderator
  • Thanks Brian, good points.  I will have to review that with my client to see if we need to go that deep, my hope is that we do not need to be 100% bullet proof, but just make it so that field criteria that we are using is not real obvious to the user.  thanks for your advice.  mark

    Mark A. Eckert SharePoint Consultant Pharmica Consulting, Inc.

    Wednesday, April 11, 2012 2:32 PM