The LotusScript

In the following routine, 'OVERFLOW_DB' is a constant with the path of the database to store all the versions. After copying all the items from the original document, I've added two fields containing the original database path and the original UniqueId of the document. After saving the version document, the version number of the original is updated.

Sub makeVersion(doc As notesdocument)
    On Error Goto catch
    Dim s As New notessession
    Dim db As NotesDatabase
    Dim newDoc As NotesDocument
   
    Set db=s.GetDatabase("", OVERFLOW_DB)
    Set newDoc=db.CreateDocument
    doc.CopyAllItems newDoc
    newDoc.ReplaceItemValue "OrigDb", doc.ParentDatabase.FilePath
    newDoc.ReplaceItemValue "OrigUnid", doc.UniversalID
    newDoc.Save True, False, True
    doc.ReplaceItemValue "version", doc.version(0)+1
   
    Goto finally
catch:
    Print "Error " & Err & " in line " & Erl & ": " & Error$
    Resume finally
finally:
End Sub

相关文章:

  • 2021-11-25
  • 2021-05-26
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2021-09-04
  • 2021-09-03
  • 2021-10-30
猜你喜欢
  • 2021-06-02
  • 2021-08-11
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2021-08-12
相关资源
相似解决方案