Hello all,I wrote an agent to move a document from one db to another after a user clicks a cretain action by creating a new document in the detination db and deleteing the old document from the current database
here is my code:
Set session = New NotesSession
Set db = Session.CurrentDatabase ’ this db Payment
Set doc=session.DocumentContext
Set Ardb=session.GetDatabase(“Server1”,“payarchives.nsf”)
Set headerview =db.GetView(“Completed Payment Orders by id”)
Set Archivesview=Ardb.GetView(“Completed Payment Orders by serial”)
If Not doc Is Nothing Then
Set existingdoc=Archivesview.GetDocumentByKey(doc.serial(0))
If doc.Location(0)=0 Then
If Cstr(doc.Serial(0))<>“” Then
If existingdoc Is Nothing Then
Set CopiedHeaderDocument=Ardb.createdocument
CopiedHeaderDocument.form=“Payment Order”
Call doc.CopyAllItems( CopiedHeaderDocument, True )
Call CopiedHeaderDocument.computewithform(False,False)
Call CopiedHeaderDocument.Save( True,False )
’ this part is for deleting the document from original database
Set deletedheaderdoc=headerview.GetDocumentByKey(doc.id(0))
Call deletedheaderdoc.Remove(True)
End If
End If
End If
End If
although the user is an author to the form I get an error"You are not authorized to perform that operation"
in this line
Call CopiedHeaderDocument.Save( True,False )
why is that
does any one have an idea about this error
thanks in advance
Dalia