Hi,
I added some new fields to the form (computed fields). I made an agent for updating the old documents.
Set ss=New NotesSession
Set db=ss.CurrentDatabase
Set doccoll=db.UnprocessedDocuments
Set doc=doccoll.GetFirstDocument
Do While Not doc Is Nothing
Call doc.Computewithform(True,False)
Call doc.Save(True, False)
Set doc=doccoll.GetNextDocument(doc)
Loop
When I check in the script debugger, than I can see that the new fields get values, but when the script finish than the fields are not updated.
Do you have any idea how to update the documents?
Attila
Subject: Update new field
Sounds like the SAVE does not succeed.
In cases like this where a few fields are added to a form, I prefer to calculate the fields in the agent and save the doc. This can be much more efficient if there are many fields on the form. In other words, you are recalculating all computed fields on the form with that method.
Another possibility is to check to see if computing the form is failing. Does it fail on all docs or just some? Try code like this:
success = doc.ComputeWithForm( False, False )
If success Then
Call doc.Save( True, True )
End If