Link to home
Start Free TrialLog in
Avatar of brianbailey
brianbailey

asked on

Indicate date that field changed to a specific value?

I am looking to find out how to indicate the date that a field was saved with a specific value.

I am wanting to do this with a calltrack form I am working on.  The form will have two status indicators in a "Status" field: either "Open" or "Closed".  The Date Open field is easy, just indicating the date that the form was created.  But as far as Date Closed, I need to find a way to populate this field with the date of the last Save when the Status field indicated "Closed".

Any ideas?
Avatar of ksi2001
ksi2001

Form Declarations

Dim  Status As String

QueryOpen

Status=source.FieldGetText("Status")

QuerySave

If Status<>"Closed" And source.GetFieldText("Status")="Closed then
   Call source.FieldSetText("DateClosed",Now)
End If



correction:

If Status<>"Closed" And source.FieldGetText("Status")="Closed then

Declare a global variable say LastStatus as string

Now in Post open record the values like this

If Not Source.IsNewDoc then
LastStatus = Source.Document.Status(0)
End if

In the QuerySave

If LastStatus <> Source.Document.Status(0) then
 Source.Document.ClosedAt = Now    ' This is the time when close status was saved
End if


~Hemanth
Avatar of brianbailey

ASKER

Okay...

I am not as familiar with Lotus Notes as you all are.  I'm not exactly sure what you mean by the following:

Form Declarations
Dim
QueryOpen/Save
Post

It is notes version 4.6 (ancient).  If you can explain to me what to do as if you were explaining it to someone who doesn't really know coding too well, I would gladly appreciate it.
SOLUTION
Avatar of HemanthaKumar
HemanthaKumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok HemanthaKumar,

I set it up just like you said.  Created one where status was open and one where status was closed.  No matter what status i saved it as, the current date populated in the Date Closed field (which is an improvement, I admit).  What am I doing wrong?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It works!

You guys rock!  I hope I did the points right.  Let me know if you didn't get them.