2 Replies Latest reply on May 8, 2012 12:00 PM by Dillik

    Timestamp When a Field's Value is Changed

    CraigRozelle

      Title

      Timestamp When a Field's Value is Changed

      Post

      I have a field entitled "job_status" in a form called "Work Order" with a radio button set that includes the following options:

      (1) "Unassigned"

      (2) "Pending Job Start"

      (3) "In-Process"

      (4) "Work Completed"

      (5) "Invoiced"

      (6) "Closed"

      This field will be changed as the project progresses from 1 to 6. I have created timestamp fields to correspond to each of the 6 statuses. I would like a timestamp to automatically populate when the user selects each of the statuses. For example, the default value is "Unassigned." When the user changes that status to "Pending Job Start," I would like the corresponding timestamp field to populate at the moment of that change. The purpose of all of this is to be able to report on SLA's.

      I'm sure this is a fairly routine use case, but I'm struggling with how to make the timestamp work. If there is a better way to structure the whole thing, I'm open to any ideas.

        • 1. Re: Timestamp When a Field's Value is Changed
          philmodjunk

          It might be simpler to create a table of related records where you create a record with the next status each time the status change. Then On Create auto enter settings on a time stamp field can capture the current date and time in a timestamp field.

          Using a single record with a radio button formatted single status field would require a script performed by the OnObjectModify trigger you'd set on your radio button field. The script would use the value of the radio button field to determine which field to update with get ( currentTimeStamp ).

          • 2. Re: Timestamp When a Field's Value is Changed
            Dillik

            Why not set an auto-enter calculation for each timestamp?  Say, for Timestamp3 (the one that logs when option 3 was selected), use an auto-enter calc of "If ( job_status = 3; Get ( CurrentTimestamp ) )".  Make sure to specify that the auto-enter calc shouldn't override existing values.

            Edit: You could also condense this functionality into a single repeating timestamp field using the following auto-enter calc: "If ( Extend ( job_status ) = Get ( CalculationRepetitionNumber ); Get ( CurrentTimeStamp ) )".