I have a database that contain documents, one document per user address. There is another set of documents which contain the address info plus additional info.
There should be an equal number of these documents. But there are documents missing from the second set. I need to write a LotusScript program that will read all the documents from the two collections, and if it finds a document missing from the second collection, it must create a new document in that second collection that contains the address infor from the first.
Can anyone out there suggest how the LotusScript program will look like that will do this?
Thanks!
Subject: Compare doc collections and create new doc for missing doc
run whlie or for loop so that you can compare every document values but run the loop with in another loophope it helps
Subject: RE: Compare doc collections and create new doc for missing doc
Yes, I sort of new that’ s what I have to do but I seldom write Script and I don’t know how it would look. Do you have any examples of some code around that you could paste up here?Thanks!
Subject: RE: Compare doc collections and create new doc for missing doc
Dim DCx as NotesDocumentCollection
Dim DCy as NotesDocumentCollection
Dim docX as Notes Document
Dim docY as Notes Document
Dim NoMatch As Boolean
Set docX = DCx.GetFirstDocument
While Not docX is Nothing
NoMatch = True
Set docY = DCy.GetFristDocument
While Not docY Is Nothing and NoMatch
.. Do stuff to find match or not
... if match is found then set NoMatch=False
Set docY = DCy.GetNextDocument( docY)
Wend
if NoMatch then
... The Document was not found .. Created it.
End if
Set docX = DCx.GetNextDocument( docX )
Wend