Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: Toma Bogdan am 10.06.04 - 13:24:07

Titel: I can't copy docs from a db to another
Beitrag von: Toma Bogdan am 10.06.04 - 13:24:07
I can't copy docs from a db to another (only 2 docs from 100). The docs have some readers fields (with users and roles). On both dbs I have Manager access and I have a role that is a readers field.

Why doesn't works properly ?

Ps. I have tried to copy the docs with the classic method: Copy & Paste and I didn't receive any error message ! I saw only 2 docs from 100 that I intend to copy ;-(
Titel: Re:I can't copy docs from a db to another
Beitrag von: Semeaphoros am 10.06.04 - 14:13:37
Have you defined the same role in the destination DB?

Did you check, if the number of docs in the dest db did increase by two or by 100 (# of docs to be found in the database-properties)
Titel: Re:I can't copy docs from a db to another
Beitrag von: Toma Bogdan am 10.06.04 - 14:20:09
Have you defined the same role in the destination DB?

Did you check, if the number of docs in the dest db did increase by two or by 100 (# of docs to be found in the database-properties)
yes, it is the same role on both dbs. I've check the number of docs it was increased by 2.

if I try to copy a doc that I can't copy, when I press CTRL+V (Paste) a search within category appears  ???

Titel: Re:I can't copy docs from a db to another
Beitrag von: Glombi am 10.06.04 - 14:26:18
Is there an item called "$KeepPrivate" with a value of "1" ?

$KeepPrivate = "1" <=> "Prevent from copying"

Andreas
Titel: Re:I can't copy docs from a db to another
Beitrag von: Toma Bogdan am 10.06.04 - 14:44:08
Is there an item called "$KeepPrivate" with a value of "1" ?

$KeepPrivate = "1" <=> "Prevent from copying"

Andreas
you have right  :) 10x! so I need to run a script !

but why some docs have (2) and some haven't (98) this value ?
Titel: Re:I can't copy docs from a db to another
Beitrag von: Semeaphoros am 10.06.04 - 15:46:53
You have to ask the creator or look at the creating application, this field will not be added automatically
Titel: Re:I can't copy docs from a db to another
Beitrag von: Toma Bogdan am 10.06.04 - 16:48:08
You have to ask the creator or look at the creating application, this field will not be added automatically
I am the author  :D

10x and regards !
Titel: Re:I can't copy docs from a db to another
Beitrag von: Glombi am 10.06.04 - 17:00:08
It is a Mail-In database?
Titel: Re:I can't copy docs from a db to another
Beitrag von: Toma Bogdan am 10.06.04 - 20:37:30
It is a Mail-In database?
no; it is tru that some docs was copied from a mail db but there are some docs also that are created directly in this db.
Titel: Re:I can't copy docs from a db to another
Beitrag von: TMC am 10.06.04 - 21:00:07
no; it is tru that some docs was copied from a mail db

I usually copy only the needed source items to a new document.
Usually I only need the fields 'Date', 'Receiver', 'CC', 'Subject' and 'Body' of a mail-doc.
This prevents having unnecessary fields (like KeepPrivate and all the other stuff which provides an email-doc) in my target database.

Maybe that would be a solution for you?

Matthias
Titel: Re:I can't copy docs from a db to another
Beitrag von: Toma Bogdan am 10.06.04 - 21:21:53
no; it is tru that some docs was copied from a mail db

I usually copy only the needed source items to a new document.
Usually I only need the fields 'Date', 'Receiver', 'CC', 'Subject' and 'Body' of a mail-doc.
This prevents having unnecessary fields (like KeepPrivate and all the other stuff which provides an email-doc) in my target database.

Maybe that would be a solution for you?

Matthias

you have right but I copy the mails using the code Set docnou= doc.Copytodatabase(db3) so I can't decide which fields I don't need to be copied... isn't it ?
Titel: Re:I can't copy docs from a db to another
Beitrag von: TMC am 10.06.04 - 21:33:23
You're right, with this method you copy the whole document.

But you could use the CopyItemToDocument method of the notesItem - class.

Example:
Dim dbNew As New NotesDatabase("" , "MyDB.nsf") 'Target DB
Set docNew = New NotesDocument( dbNew )
'.......
Set itemSender = doc.GetFirstItem( "From" )
Call itemSender.CopyItemToDocument( docNew, "MyItem_Sender" )

Give it a try :-)

Matthias
Titel: Re:I can't copy docs from a db to another
Beitrag von: Toma Bogdan am 11.06.04 - 07:50:47
You're right, with this method you copy the whole document.

But you could use the CopyItemToDocument method of the notesItem - class.

Example:
Dim dbNew As New NotesDatabase("" , "MyDB.nsf") 'Target DB
Set docNew = New NotesDocument( dbNew )
'.......
Set itemSender = doc.GetFirstItem( "From" )
Call itemSender.CopyItemToDocument( docNew, "MyItem_Sender" )

Give it a try :-)

Matthias
good ideea ! 10x a lot !  8)