Solved

Linking documents.

Posted on 2004-10-11
10
333 Views
Last Modified: 2013-12-18
I have a document number that is created programatically in this document and this number corresponds to another form in the database. My question, how can create a link to this number.
     Form 1      ABC no.  -   123     -  I should be able to link to form 2 when I click on 123
     Form 2      DEF no.  -   456
Thanks
 
             
0
Comment
Question by:cyle
10 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12279369
Create a view with first column the no field and second col evaluating to @DocumentUniqueID...

Do a dblookup to this view and extract the 2nd col using the no field as the key

eg;
@DBLookup( "Notes":"NOCache"; @DBname; "VIewToLook"; No_FIELD_Name; 2)

Place this formula in a computed field.. When you save and reopen this will become a link

~Hemanth
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 12284098
or if Form1 is saved and after that form2 is opened, then u can use Form properties.
in the second tab, Inherit ... enable this option.

In the form2 field, u should have one RTF field and give the field name in the form properties. this will also creates link in form2 for form1 doc.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12285737
I couldn't understand the question.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:cyle
ID: 12288067
FORM1 has a number created automatically when saved. Let's say 1234. Then, you click a button in FORM2 to create FORM2. Form2 also has its own number say 4567.

Now, when I open FORM1 again, it will have both numbers shown.

FORM1              1234
                         4567

this number should be able to open up each other or linked to each other. When I click on 4567 FORM2 should come up.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12297949
I typed a reply to your question. But before submitting it I found it was just an elaboration on Hemantha's post. He read the question correctly (that is if i read you last comment correctly). Go ahead with that. If you face a problem, let us know.
0
 
LVL 3

Accepted Solution

by:
Andrea Ercolino earned 500 total points
ID: 12300937
I do not completely understand the flow of actions...
  1- You create a doc1 with Form1, and at saving time its ID number is generated.
  2- Then you create a doc2 with Form2, and at saving time its ID number is generated.
  3- You finally want doc1 to show a link to doc2 named doc2.ID( 0 ) and doc2 to show a (backward) link to doc1 named doc1.ID( 0 )

Here the problem is that when doc1 is created, it does not know anything about doc2 yet, so it's not possible to create a (forward) link at that time. Instead when doc2 is created, it already knows all about doc1, so you just need to execute the following code at the end of the querysave event script fo the Form2 form, after the generation of ID

  Dim doc2 as NotesDocument
  Set doc2 = Source.Document
  Dim doc1 as NotesDocument
  Set doc1 = session.CurrentDatabase.GetDocumentByUNID( doc2.UNID1( 0 ) ) ' this could be different
  Dim link1 as New NotesRichTextItem( doc1, "Link" )
  Call link1.AppendDocLink( doc2, "", doc2.ID( 0 ) )
  Call doc1.Save( True, True )
  Dim link2 as New NotesRichTextItem( doc2, "Link" )
  Call link2.AppendDocLink( doc1, "", doc1.ID( 0 ) )

Then
  1- put a Link richtext field in each form (Form1 and Form2) for showing the link
  2- put a UNID1 field (Computed for display) in the Form2 form and use @InheritedDocumentUniqueID as its formula
  3- check the flag in the Form2 form where says "On Create - Formulas inherit values from selected document".
  4- Finally always create doc2 having selected doc1 before, either in a view or opened.

NOTE that if you want to use an different method for getting at doc1 from doc2, then you should change the line marked in the code snippet, and points 2 through 4 maybe discarded altogether
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12727084
If the problem was cross linking documents, I think my comment gives the right solution.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

786 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