Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Indicate date that field changed to a specific value?

Posted on 2003-11-20
8
Medium Priority
?
327 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
Independent Software Vendors: 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

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!

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

618 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