Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How do i capture date and time when status of task is changed? I have 3 different columns Date Assigned, Date In Progress, Date Completed. When a task is assigned to a user, is there a way Date assigned column gets the date & time automatically? If yes, how do we do. Similarly when user changes task to In Progress state, Date In Progress should get date & time & similarly when task is closed by user, Date Completed column should get the timestamp so that i can calculate time take for each task and status in between. I use Sharepoint 2010.

share|improve this question

1 Answer 1

You need a item event handler, something like this:

   public override void ItemUpdated(SPItemEventProperties properties)
   {
      if(properties.BeforeProperties["Status"]!=properties.AfterProperties ["Status"]){
         properties.ListItem["Date In Progress"]=DateTime.Now;
       }
   }
share|improve this answer
    
Let's add some null checks to the Before and After properties too –  Robert Lindgren May 2 '13 at 10:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.