?
Solved

Indicate date that field changed to a specific value?

Posted on 2003-11-20
8
Medium Priority
?
326 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
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!

 

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 1000 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 1000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

764 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