PutAllInFolder Question

I need to get document collection from base B. Agent start in base A and i’d like to put document collection in folder in base A.Help me please.

’ get document collection from base B

Set db2 = New NotesDatabase( “srv1”, “base_B.nsf” )

Set collection = db2.Search(SearchString$, Nothing, 0)

’ put document collection in folder in base A

Set db = New NotesDatabase( “srv1”, “base_A.nsf” )

Set view = db.GetView(“SearchFolder”)

Call collection.PutAllInFolder( “SearchFolder” )

But collection go to folder in base A!!!

Where is mistake???

Subject: PutAllInFolder Question

Views and folders can only contain documents in their own database.

Subject: RE: PutAllInFolder Question

How can I solve this problem???

Subject: please tell us just What the Problem is …

i.e. what business functionalityyou need to achieve and then perhaps we can suggest a means.

tell us what the user needs to be able to do/see

and a bit about the databases involved

and we will try and find a mthods that could work

I’m sure you know but we dont.

Unfortunately, to acheive the effect that you need, you’ve currently selected a technical method that seemed plausible to you

but I’m afraid that as other posters have indicated it simply cant work

a folder in database B can only hold documents in Database B

what we need to do is accept that.

But does that really stop your solution? For example - can you not have the folder in database B, but use it , ebnem show it from functionality in Database A?

please dont reject that out of reflex. Consider that Database A and B are obviously initimately related in any case. What’s wrong with B having a few veiws or folders that are used or only visible through database A?

(Remember an Notes application need not be the result of ONE NSF file. It is often that way)

If there are good reasons against this - well if we know what EFFECT you need to achieve then perhaps we can suggest an alternative method than may work.

Subject: RE: please tell us just What the Problem is …

About business functionality:I need to have database that can search and store search criteria and results by many databases. It’s something like multisearch database.

Subject: RE: PutAllInFolder Question

Hi Stas,I think what you’d need to do to get past this is to copy all of the documents in your collection to the second database and then put them in the folder.

You’d have to cycle through the documents and copy them over using:

Set newNotesDocument = notesDocument.CopyToDatabase( notesDatabase )

Then generate a new collection with the copied over documents to put them into the folder.

Though I’m not sure whether this is viable for the solution you’re thinking of. The documents won’t keep any link to the original documents

Hope this helps,

Brian

Subject: RE: PutAllInFolder Question

Hi Brian! Thanks! Is it possible to get links to documents in other bases???

Subject: RE: PutAllInFolder Question

Hi Stas,I’m not sure exactly what you mean.

You can make document links as a one way link to a document in a different database, so to make that link in database A to a document in database B, you would have to create a document in database A with a doc link in database B.

But I think that for your purposes you would need fields in the document in database A that are updated when database B updates. This is not possible.

What you could do though is schedule an agent to update documents in database A when their corresponding documents in database B, C & D are updated.

Thanks,

Brian

Subject: RE: PutAllInFolder Question

Brian, there is no need to update doc between databases, just links for documents :slight_smile: i try it now

Subject: PutAllInFolder Question

making sure i got this straight, You have a collection that comes from database B, and you want to put it in a folder in database A.

The PutAllInFolder command will work in the current database the collection was declared in, so when you call the method you’ll only be putting all the documents in the “SearchFolder” of database B (where you got the collection). In order to place the documents in another database you would have to copy them to the other databse then add those copies to the folder…i think you would have to run thru the collection and do this one by one but im not 100% sure about that