Solved

Indicate date that field changed to a specific value?

Posted on 2003-11-20
8
319 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
  • 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to automate deletion of content in Lotus Notes mailboxes 3 207
Lotus Notes 6.5.5 6 207
Lotus Domino server 9 7 69
Domino 8 run a specific agent on all nsf in a folder 9 40
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

912 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now