Solved

Indicate date that field changed to a specific value?

Posted on 2003-11-20
8
325 Views
Last Modified: 2013-12-18
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?
0
Comment
Question by:brianbailey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 2

Expert Comment

by:ksi2001
ID: 9789797
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



0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9789806
correction:

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

0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9789874
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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:brianbailey
ID: 9790552
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.
0
 
LVL 24

Assisted Solution

by:HemanthaKumar
HemanthaKumar earned 250 total points
ID: 9790619
Open the form in design mode.. by choosing menu View..Design

This will open a raw design of the db. Now choose Forms.. This section contains list of forms used in the db.

Select the form which you want to make changes to and double click on it open it in design mode

When you open the form, it will expose fields and script events.. Program pane shows the events. When you select Globals (denoted as (Global))and paste this

Dim lastStatus as String

Now click on the form name denotes as (Form)
This will expose PostOpen and QuerySave events

Select the postopen event and paste this script

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

Similarly , select In the QuerySave event paste this

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

Now save the form and test it.

0
 

Author Comment

by:brianbailey
ID: 9791305
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?
0
 
LVL 2

Accepted Solution

by:
ksi2001 earned 250 total points
ID: 9791467
here is a combination of mine and Hemantha's code which should work correctly:


leave declaration and postopen as Hemantha said

for the querysave event:

newStatus=Source.Document.Status(0)

If LastStatus <> newStatus and newStatus="Closed" then
   Source.Document.ClosedAt = Now    
End if




0
 

Author Comment

by:brianbailey
ID: 9791523
It works!

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question