AnsweredAssumed Answered

Timestamp script problem

Question asked by LeoB on Feb 11, 2010
Latest reply on Mar 7, 2011 by james.gould


Timestamp script problem


I've got two timestamps in one table.  One created automatically for any modification and another created via a script for when a button is clicked to approve the record (button access controlled via UAC).  Both timestamps work fine.


Now, I'm trying to write a simple script via a trigger that runs whenever the modification timestamp changes.  I want it to compare the modification timestamp to the approval timestamp and if it is after the approval, then I want it to clear two fields (ApprovedBy and ApprovalDate), and possibly replace the ApprovedBy field with some text like "Requires reapproval."


I can't get anything to work.  Here's the basic script:


If [Activity::ModificationTimeStamp > Activity::ApprovalTimeStamp]

   Set Field [Activity::ApprovedBy; ""]

   Set Field [Activity::ApprovalDate; ""]

End If


I used the Set Field function rather than Clear function as previous advice on this forum recommended that.


I tried it on both OnObjectModify and OnObjectSave, and nothing.


What am I doing wrong?