I have an action button in a View that uses Lotusscript to modify fields in UIDocs like doc.Field1, doc.Field2 by going through a document collection until the fields in all selected doc have been updated.
This works fine and each document is updated with the new field values as they should.
Here is my problem. All documents that have been "touched/processed" by my script cannot be modified/saved anymore. I can open the modified documents, but when I enter new information in any of the document fields and use File - Save it does not complain but does not save the new info.
All other documents in the dB are fine - my script must do something to each processed document to cause this behavior. I am kind of stunned - some kind of lock, undefined state?
Any ideas how to make this right again would be appreciated. Code looks something like below -some items are commented out - duplicates at this point of troubleshooting. Did I get confused with the docs in the current collection vs the parent docs that holds the info???
It does update correctly but the file state is compromised somehow ...
Sub Click(Source As Button)
Dim session As New notessession
Dim db As notesdatabase
Dim view As notesview
Dim doc As notesdocument
Dim dc As notesdocumentcollection
Dim ws As New NotesUIWorkspace
Dim uiview As NotesUIView
Dim uidoc As NotesUIDocument
Dim rt As NotesRichTextItem
Dim InputForm As NotesDocument
Dim f As Integer
Dim count As Integer
Dim scount As String
Dim filename As String
Dim VesselNew As String
Dim VoyageNoNew As String
Dim DocumentCutOffnew As String
Dim DocumentCutOffTimenew As String
Dim FCLCutOffnew As String
Dim FCLCutOffTimenew As String
Dim ETDnew As String
Dim ETAnew As String
Dim flag As Boolean
'flag = ws.DialogBox( "Vessel_Voyage_update", True, True, , True, True, , "Update Dates for selected Documents", , , , True )
flag = True
VesselNew = Inputbox$ ("Please Enter new Vessel Name - or current Vessel if no Change needed:", "Vessel" , VesselNew , 30, 60)
VoyageNoNew = Inputbox$ ("Please Enter new Voyage Number - or current Voyage No. if no Change needed:", "VoyageNo" , VoyageNoNew , 30, 60)
DocumentCutOffnew = Inputbox$ ("Please Enter new Doc CutOff Date:", "DocumentCutOff" , DocumentCutOffnew , 30, 60)
DocCutOffTimenew = Inputbox$ ("Please Enter new Doc CutOff Time", "CutOffTime" , DocCutOffTimenew , 30, 60)
FCLCutOffnew = Inputbox$ ("Please Enter new FCL CutOff Date", "FCLCutOff" , FCLCutOffnew , 30, 60)
FCLCutOffTimenew = Inputbox$ ("Please Enter new FCL CutOff Time", "FCLCutOffTime" , FCLCutOffTimenew , 30, 60)
ETDnew = Inputbox$ ("Please Enter new ETD", "ETD" , ETDnew , 30, 60)
ETAnew = Inputbox$ ("Please Enter new ETA", "ETD" , ETAnew , 30, 60)
Set db=session.currentdatabase
Set uiview=ws.Currentview
Set dc=uiview.documents
Set doc=dc.Getfirstdocument
count=0
If flag = True Then
While Not (doc Is Nothing)
doc.Vessel = VesselNew
doc.VoyageNo = VoyageNoNew
doc.DocumentCutOff = DocumentCutOffnew
doc.DocCutOffTime = DocCutOffTimenew
doc.FCLCutOff = FCLCutOffnew
doc.FCLCutOffTime = FCLCutOffTimenew
doc.ETD = ETDnew
doc.ETA = ETAnew
doc.SaveOptions="0"
doc.Save True, False
count=count+1
Set doc=dc.GetNextDocument (doc)
Wend
Else
Messagebox "*** Did Nothing ! ***"
End If
Close f%
scount = Cstr(count)
Messagebox "*** " + scount + " Files have been updated with new Vessel / Voyage and new Dates ***"
Dim workspace As New NotesUIWorkspace
Call workspace.ViewRefresh
End Sub