[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

A True Copy

Posted on 2006-06-07
16
Medium Priority
?
292 Views
Last Modified: 2013-12-18
I want to select documents in a view and copy them to another view. I want to make a true copy not just a reference to the same selected documents. How can this be done using an action button in the view?
0
Comment
Question by:schmad01
  • 8
  • 6
  • 2
16 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16852261
I was starting with:

    @Command( [EditCopy] );
    @Command( [OpenView] ; viewName ; key ; newinstance )
    @Command( [EditPaste] )

and then I wondered... Copy from one view to another view? In the same database? Documents are not "in" a view, documents are selected by a view for display. Or do they have to be copied to another database?
0
 

Author Comment

by:schmad01
ID: 16852315
Well, true, I know, I was just using wording it that way so the experts would understand what I want. So, I guess what I am asking is to make a copy to the same database. Now, I am thinking, if I do that, how will a document be distinguished from it's copy? A value in a hidden field?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16852889
A copy of a document is in all respects the same, only the hard Notes values are set to indicate a new document: Date Created, Date Modified, Creator, and the NoteID and UniversalID. The fields are the same, even the Form field, which means that if you copy a document from one view and paste it into another, it won't show up (normally) in the view you paste it in unless the Select statement of that view would include that document. It will however appear in the original view, as a duplicate of the original document.

Why the copy, why do you need it?? There may be other Notes built-in mechanisms that might prove to be more interesting than a mere copy/paste.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:marilyng
ID: 16858256
Maybe set the versions, so that new versions are the main and previous ones are the replica. ? Just a thought. :)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16860465
That's my drift, yes... (as implied by "other Notes built-in mechanisms")
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16860486
Grin - I seem to recall in a previous question you got the points for specifiying the two  Todo views I missed, in spite of my inference that the views were there.

But, yes, versions can be considered "other Notes built-in mechanisms."  Most people ignore these, and they are quite usefull.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16862784
No hard feelings... LOL
0
 

Author Comment

by:schmad01
ID: 16869866
How do you set versions?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16871456
Notes versioning is a means to save ALL versions of a document. Different versions of a document are stored as a response hierarchy. Versioning can be done in three ways: when a document is saved, the modified document will be the parent of the existing document, or the child, or a sibling (with the same parent). On the Form Properties, first tab, see Versions and Versioning. Advantage: you'll never lose a version. Disadvantage: you'll never lose a version. For every small change and save of a document, a new document is created. You need some clever mechanism to prune your hierarchy, i.e. to remove useless intermediate documents.
0
 

Author Comment

by:schmad01
ID: 16894107
Suppose I just wanted to make a copy of a form, call it a different name then the original. How would I make a copy of a document to the same database using the new form? Maybe this is the way I want to do it?  I don't want responses or siblings, just a new copy.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16894392
A new copy, with a different form name in it?

Button "Copy to Different form":

    Dim ns As New NotesSession
    Dim db As NotesDatabase
    Dim dc As NotesDocumentCollection
    Dim doc As NotesDocument
    Dim newdoc As NotesDocument

    Set db= ns.CurrentDatabase
    Set dc= db.UnprocessedDocuments
    Set doc= dc.GetFirstDocument
    Do Until doc Is Nothing
        Set newdoc= doc.CopyToDatabase(db)
        newdoc.Form= "Different"
        Call newdoc.Save(True, False)
        Set doc= dc.GetNextDocument(doc)
    Loop

or something very close to this code...
   
0
 

Author Comment

by:schmad01
ID: 16894432
At the same time I want to set the field "release" to "Yes".  Can you add that in there?
0
 

Author Comment

by:schmad01
ID: 16894448
Sorry, I wasn't clear. I want to set the field in the different form called "release" to "Yes".
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 1000 total points
ID: 16894686
C'mon, that's one thing I hope you can do yourself...

A 99% hint: look at the line with newdoc.Form
0
 

Author Comment

by:schmad01
ID: 17050240
Yes, I was getting a little lazy.  That's it! Thanks, sjef.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17050575
:-)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Screencast - Getting to Know the Pipeline
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question