Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Passing arguments when creating a new document

Posted on 2002-04-26
6
Medium Priority
?
193 Views
Last Modified: 2013-12-18
From a document opened, I want a buttom to create a new document in another database on the same server, but I want to have a link to the new document, in order to associate the two documents.  I do prefer to create the new document and have the possibility to edit that new form.  I did try with @Command([compose];), but I do not know how to pass the link. Please assist.
0
Comment
Question by:Enrique040897
  • 4
  • 2
6 Comments
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6971691
Well, unless you dont save the current document you cannot pass the document link to the other database...
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6971710
Hi there !

Try this code. This will save the current Document and create a link in the target database.  You cannot do a link without saving the current document.  Thats why this approach.

Change all the values and just put it under a button.

Good Luck!
Arun.
     
     
     Dim ss As New notessession
     Dim ws As New NotesUIWorkspace    
     Dim uidoc As NotesUIDocument    
     Dim db As NotesDatabase
     Dim tardb As NotesDatabase
     Dim curDoc As NotesDocument
     Dim tarDoc As NotesDocument
     Dim rtitem As NotesRichTextItem
     
     Set db = ss.CurrentDatabase
     Set tardb = New NotesDatabase( ss.CurrentDatabase.Server , "data\am174\webtest.nsf") ' Change the path for new database
     
     Set curDoc = db.CreateDocument
     curDoc.Form = "Test"  'The name of the form that you are composing....
     Call curDoc.Save(True,False)
     
     Set tarDoc = tardb.CreateDocument
     tarDoc.Form = "Test1" ' The form name in the target database
     Set rtitem = New NotesRichTextItem(tardoc , "Body" ) ' Body is the Field that contains the doc link
     Call rtitem.AppendDocLink(curDoc , "Alternate text when moused !" )
     
     Call tarDoc.Save(True , False)
     
     Set uidoc = ws.EditDocument(True , curDoc , False , "" )    
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6971818
What i am doing in the code is...

Create a document "A" and save it.
Create a document "B" with doclink in the second database pointing to document "A".
Now open document "A" in edit mode as if you are composing the document.

If you wish to cancel the opened document its not possible now since there is already a document pointing to this one and this one is already saved.

:-(
0
Independent Software Vendors: 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!

 

Author Comment

by:Enrique040897
ID: 6982040
Sorry for the delay. I was not on my workplace. I will let you know. But I want something like this.  Just imagine that you are filling a person record.  Then, you want to add dependant records.  Those records should be linked to the person record.  Then, if I want to open a person record, I can be able to access its dependant records.
0
 
LVL 9

Accepted Solution

by:
Arunkumar earned 375 total points
ID: 6983487
       Dim ss As New notessession
     Dim ws As New NotesUIWorkspace    
     Dim uidoc As NotesUIDocument    
     Dim db As NotesDatabase
     Dim tardb As NotesDatabase
     Dim curDoc As NotesDocument
     Dim tarDoc As NotesDocument
     Dim rtitem As NotesRichTextItem
     Dim rtitem2 As NotesRichTextItem
     
     Set db = ss.CurrentDatabase
     Set tardb = New NotesDatabase( ss.CurrentDatabase.Server , "data\am174\webtest.nsf") ' Change the path for new database
     
     Set curDoc = db.CreateDocument
     curDoc.Form = "Test"  'The name of the form that you are composing....
     Set rtitem2 = New NotesRichTextItem(curDoc, "Body")
     Call curDoc.Save(True,False)
     
     Set tarDoc = tardb.CreateDocument
     tarDoc.Form = "Test1" ' The form name in the target database
     Set rtitem = New NotesRichTextItem(tardoc , "Body" ) ' Body is the Field that contains the doc link
     Call rtitem.AppendDocLink(curDoc , "Alternate text when moused !" )
     
     Call tarDoc.Save(True , False)
     
     Call rtitem2.AppendDocLink(tarDoc , "Alternate Text when moused ! ")
     Call curDoc.Save(True,False)
     
     Set uidoc = ws.EditDocument(True , curDoc , False , "" )    

=============

The above code links both the target document to the source and the source to the target.  Both are saved the moment created so that they can be referenced back and forth.

You can set the target document with values so that, when you open that document you will see that it depends on the current document.

Get Back if you have more questions!
Arun.
0
 

Author Comment

by:Enrique040897
ID: 6991865
Arunkumar , could you please modify the script in order to use it from an opened document. (to create a new document from an opened document.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

877 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