Solved

Passing arguments when creating a new document

Posted on 2002-04-26
6
180 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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 125 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
authenticating IIS users via a Lotus Domino Server 5 189
Lotus Domino 9.0 install on same pc with 8.5.3 9 134
Domino Lotus Notes Client 4 72
Using @Prompt in a Queryclose Event 14 84
For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html

839 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