Passing a parameter to LotusScript

70 pts.
Tags:
Lotus development
LotusScript
Hi, I have a lotus script which is used to copy all message from one database to another. For that am calling an agent from my application ( MFC ). Now the problem is i need to pass specific Documents only to copy as a input for my lotus script. But i dont know how to Do it. Can any body help me out of it. Thanks in Advance ..

Answer Wiki

Thanks. We'll let you know when a new response is added.

Paia,

Without your code, it is hard to tell you the best approach to do this, so I am going to make a few assumptions.

Use either Search or FTSearch to select the specific records that you want from one database. Then iterate throug the document collection and use the CopyToDatase method to create a copy of each document to the other database.

<pre> Dim session As New NotesSession
Dim dbA As NotesDatabase
Dim dbB As NotesDatabase

Dim dc1 As NotesDocumentCollection
Dim dc2 As NotesDocumentCollection
Dim doc As NotesDocument

Dim dateTime As New NotesDateTime(Cstr(Datenumber(1999, 5, 1)))

Set dbA = session.CurrentDatabase
Set dc1 = dbA.FTSearch(“Paia, Inc.”, 10)

Set doc = dc1.GetFirstDocument()
While Not(doc Is Nothing)
Call doc.CopyToDatabase( dbB)
Set doc = dc1.GetNextDocument(doc)
Wend

Set dc2 = dbA.Search(“@Created >= @Adjust(@Today; 0;0;-7;0;0;0)”,dateTime,0)
Set doc = dc2.GetFirstDocument()
For i=1 To dc2.count
Call doc.CopyToDatabase( dbB)
Set doc = dc2.GetNextDocument(doc )
Next </pre>

Hope this helps!

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following