Data in Date/Time "related" to data in Dialog List

I have a form in which there are a plethora of fields, layed out on a tabbed style form. On one of the tabs is “status”. The two fields I am concerned with are “Request Status”, which is a Dialog List full of status types (complete, cancelled, pending, etc)… and “Completion Date”, a Date/Time field. I have been requested to change the form such that when someone changes the status of the request to a “closed” status (complete, cancelled, rejected), the date will auto-populate in the “Completion Date” field. I tried changing the “Completion Date” field to computed, and creating the relationship… but I have been unsuccessful thus far. The date/time field is currently “calendar control”, not “notes style”. Does it need to be “notes style” so I can make it do what I want it to do? Any guidance would be GREATLY appreciated, so I can tell the users to back up some… << grin >>

Chris Ivey

Verizon Data Services

Enterprise Network Support Services

Network Management Tools Group

Temple Terrace, Florida

Subject: Data in Date/Time “related” to data in Dialog List

I’ve got a ‘status’ field and closed date similar to what you are doing. I ran into problems with users accidently changing the status to ‘Closed’. Of course, you could just check again and remove the date if the status is changed again, but I got so confused when I was trying to figure it out, I just put all the checks in the Querysave event that checked the status to see if it was ‘Closed’ and then checked the date to see if it was filled in yet, if not, fill it with today’s date. I don’t know if that is what you would want to do, but I wanted to give you something else to think about.

Deb

Subject: RE: Data in Date/Time “related” to data in Dialog List

Deb,

 Thanks for the insight.  That is not a bad method at all, but it unfortunately will not pass requestor scrutiny.  I have been directed by the boss to make this application as easy to use as possible, and to have as many fields auto-populate as possible.  While the solution is good, and I ran it by the boss, it will unfortunately just not pass mustard.  Thanks again, though, as this is good form for some other things I am working on.

Chris Ivey

Verizon Data Services

Enterprise Network Support Services

Network Management Tools Group

Temple Terrace, Florida

Subject: RE: Data in Date/Time “related” to data in Dialog List

What exactly is the problem? You have two choices. If the date should change immediately you have to set ‘refresh fields on keyword change’ in the dialogue list and set the date input translation to @if(Status=“complete”:“cancelled”:“rejected”;@today;“”) or something similar. Disadvantage, you refresh all fields.If you can wait until the user exits the field then use the exiting event

Sub Exiting(Source As Field)

Dim ws As New notesuiworkspace

Dim uidoc As notesuidocument

Dim doc As notesdocument



Set uidoc=ws.currentdocument

Set doc=uidoc.document

If doc.status(0)="closed" or doc.status(0)="ccomnplete" or ... Then

	doc.completiondate = Today

else

doc.completiondate=“”

End If

Exit Sub

End Sub

Disadvantage, the user can close the doc without exiting the field so you have to repeat the logic in querysave, just in case.