Hello,
I have referred one script from this forum.
which is copying only one document from one document from source database to destination database. whats wrong in the code
heres the code
==========================
Sub Initialize
Dim session As New notessession
Dim db As notesdatabase,srcdb As notesdatabase,dstdb As notesdatabase
Dim view As notesview,srcview As notesview,dstview As notesview
Dim doc As notesdocument,srcdoc As notesdocument,dstdoc As notesdocument,srcdocnext As notesdocument,srcdocroot As notesdocument
Dim srcuid As String
Dim delaymonths As Long
Dim todaydate As notesdatetime, srcdocdate As notesdatetime
Set db=session.currentdatabase
Set view=db.getview(“Settings”)
Set doc=view.getfirstdocument
delaymonths=Val(doc.delaymonths(0))
Set srcdb=New notesdatabase(db.server,doc.srcdb(0))
Set dstdb=New notesdatabase(db.server,doc.dstdb(0))
Set srcview=srcdb.getview(doc.srcview(0))
Set srcdoc=srcview.getfirstdocument
Set srcdocroot=srcdoc
Set srcdocdate=New notesdatetime(srcdoc.created)
Set todaydate=New notesdatetime(“Today”)
delaydiff=todaydate.timedifference(srcdocdate)
delaysecs=delaymonths30246060
If delaydiff<delaysecs Then Exit Sub
srcuid=srcdoc.universalid
Set dstdoc=srcdoc.copytodatabase(dstdb)
If dstdoc is Nothing then Exit Sub ’ abort here if the document could not be copied
Set srcdoc=srcview.getnextdocument(srcdoc) ’ get first response doc
While srcdoc.~$ref(0)=srcuid
Set dstdoc=srcdoc.copytodatabase(dstdb)
Set srcdocnext=srcview.getnextdocument(srcdoc)
srcdoc.remove True
Set srcdoc=srcdocnext
Wend
srcdocroot.remove True ’ remove the main doc only after all responses are removed
End Sub
=================
thanks for your advice and also i didnot understood this “srcdoc.~$ref(0)” in this, what is he refering to…
regards
Sanjay