Help on terminate event

We just upgraded to R7 and experiencing a problem with one of our database. I have the following code in the Terminate Event of the “MgrAuthor” field to capture the field editor’s name, date & time… The code returns null value since the upgrade. It was working perfectly fine in R6. Anybody can help please?

Here is my code:

Sub Terminate

Dim workspace As New NotesUIWorkspace

Dim session As New NotesSession

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

MgrAuthor = uidoc.FieldGetText("MgrAuthor")

MgrApproval_a = uidoc.FieldGetText ("MgrApproval")

If MgrAuthor = "" Then     

	If MgrApproval_a <> "" Then

		

MgrAuthor = "Completed by " & session.CommonUserName & " on " & Format(Now(), "Long Date") 

Call uidoc.FieldSetText("MgrAuthor", MgrAuthor)

Call uidoc.save

End If

End If

End Sub

I am new to lotusscript and would appreciate any help on this.

Thanks in advance!

-nb

Subject: help on terminate event

It does not like the coding is wrong.

Could it be that during your upgrade you had to copy some data too? Priofiles?

The alternative will be to debug your code. Note that you can set a breakpoint at any time. So it is possible to set a breakpoint in the Terminate event during opening of your document.

Subject: RE: help on terminate event

Thanks Rob! To answer your questions, we didn’t copy documents. Existing docs migrated to the new server with the upgrade. We don’t use any profile docs in the database.I tried to debug the code with brakpoint and didn’t see any error. Any other suggestions?

Regards,

-nb

Subject: RE: help on terminate event

Well, if in the debugger all is hown as expected, you are facing a timing problem. With this I mean you are handling data that is not already available (I came across situations that in debug-mode all was well and in normal mode not).

Maybe intermediate closing (and re-open) of your document will fix it.