Lotus Notes 7 - scheduled Agent for copying parent & response docs. without changing UNID

StackOverflow https://stackoverflow.com/questions/17780589

  •  03-06-2022
  •  | 
  •  

문제

I asked a question ( Lotus Notes 7 - copy / move docs. ( parent & response docs ) without changing the UNID ? ) and I received an answer which helped me a lot! Thanks Knut Hermann!

It works OK, it is an agent working on selecting documents. I was wondering if it's possible to create a schedule agent which runs one time per day? That means the user shouldn't manually selecting the documents and run the agent.

Thank you for your time and for your sharing info!

도움이 되었습니까?

해결책

Yes, you can. Look here. You can set schedule in agent's properties:

enter image description here

You can select which documents will be selected. In example will be all database's documents selected. If you select "None" it's up to you to select your documents in agents's code in a e.g. NotesDocumentCollection.

For your case the easiest will be to select all documents and add an if statement to test if document is not yet in target database:

Set docSource = col.Getfirstdocument()
While Not docSource Is Nothing
    If docTarget.GetDocumentByUNID(docSource.UniversalID) Is Nothing then
        Set docTarget = dbTarget.Createdocument()
        Call docSource.Copyallitems(docTarget, True)
        docTarget.UniversalID = docSource.UniversalID
        Call docTarget.save(True, False)
        Set docSource = col.Getnextdocument(docSource)
    End If 
Wend
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top