copytoDatabase

hi alli want to copy document from one database to another. i am using copytodatabase method on webquerysave event. i am using replica id of second database(to which database i have to copy the document) in the profile document of first database. but i am not seeing document which is in first database , that is in second database. what may be the problem?

or what is right way to copy document from one to another database by using copytodatabase method by ur experience?pls tell me.

thanks in advance.

Subject: copytoDatabase

CopyToDatabase is the correct way of moving the document at once to another database.

You need to go step by step of what exactly is happening -

  1. Check whether the Database object of second database is present or not.

  2. If doc has authors or readers fields then make sure that user is present and has appropriate access.

  3. In the form security there is option of who can read the document. Check that one.

  4. View which is displaying the document should be configured correctly, i.e view selection formula etc.

–Phani

Subject: RE: copytoDatabase

thanks kiranwhat u told me to do is too ok. but fact is

1.second database is there only. i am developing both the database.

2.doc is not having authors & readers field. i am having manager access to both databases.

3.who can read the document is having my name in both the database’s forms

4.view selection formula i writen the form name which is common to both the database & another form(profile document) where replica id of first database is stored. So in this case at least i should see the document which is created in first database, same in the second database.

is i am right to write the view selection formula?

next is i am setting second database as

set seconddb=new notesdatabase(servername,replicaid)

but i am geting error on console is, database is not been opened yet

pls give any suggestion.

Subject: RE: copytoDatabase

Instead use the following statement -

set seconddb = session.getdatabasebyreplicaid(…)

Look for more help in Lotus Designer help. Then use the following statement -

if not seconddb is nothing then

'do something here

end if

–Phani

Subject: RE: copytoDatabase

hii think getdatabasebyreplicaid is not there? openbyreplicaid is there. isn’t it?

i used it but giving error as invalid replica id (12345678:12345678)

Subject: RE: copytoDatabase

Yep…I got confused.

Always remove “:” (colon) from the replia id. Lotus Script doesn’t require this. But formula language do require colon.

So, your db replica id now becomes 1234567812345678.

–Phani