Solved

Passing arguments when creating a new document

Posted on 2002-04-26
6
178 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:Enrique040897
Comment Utility
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
Comment Utility
       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
Comment Utility
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 run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now