It's been a while since I posted in here but I have an odd problem that I'm hoping someone can help me with.
I have a function in a script library which creates a new copy of my existing document. The document is a person record in an HR system and in the event that their position changes I want to create an archive copy of their old HR document.
Although the code works the new document can't be read or even seen by me. I can see it if I run Notes on the server and access the database that way. I do have Readers and Authors fields on the original document (Employee) and the archived copy (Employee Position). These fields still exist on the EP document and look to be correct but in fact their type has changed from Text List to Text.
Why does this happen ? What's the best way to copy a multivalue Authors field from one document to another ?
Code to do the copy is here:
Public Function CreateEPR As Integer
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim currentdoc As NotesDocument
Dim db As NotesDatabase
Dim session As New NotesSession
Set db = session.CurrentDatabase
Set doc = New NotesDocument(db)
Set uidoc = workspace.CurrentDocument
Set currentdoc = uidoc.Document
currentdoc.CopyAllItems doc, False
Call doc.Save (True,True)