Solved

Document link problem....

Posted on 2001-06-09
9
406 Views
Last Modified: 2013-12-18
Hi experts,

I'm able to create a documentlink in a document, to a document in another database using @DbLookup. The documentlink is present on the form, but when i click the link a message appears:

The linked document cannot be found in the view.

What can be wrong ? Is the documentlink incomplete, so it's looking in the local database for the document ?
How can I generate a "complete" documentlink, that jumping to the document in the other database ?

Greetings,

Bob
0
Comment
Question by:oosterbaan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6172022
The best method would be to use Richtext method AppendDocLink, This creates fully qualified link with server name and replica id of the database.

By the way what is your method of creating doc link. If it is through dblookup, then how ??? Most of the tweaks desn't work properly.

~Hemanth
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6172040
0
 
LVL 1

Author Comment

by:oosterbaan
ID: 6172269
Hi Hemanth,

This is the way how I did it...

I've created in every document in the source database a computed when composed textfield, containing the formula @DocumentUniqueID.
In the target database, I'm using the @DbLookup in a computed textfield, the get the documentlink from the source document:

@DbLookup("":"NoCache";"<replicaID sourceDB>";"<ViewName>";"<key to document>";"<Fieldname containing DocuniqueID>").

This is working very well, when the document is in the same database...

Greetings,

Bob
0
Industry Leaders: 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 1

Author Comment

by:oosterbaan
ID: 6172313
I have no knowledge with writing LotusScript, but is there a way to create a button (instead of a doclink) to jump to a other form in another database. I have red something about a LotusScript command called GetDocumentById.
I can imagine that I set the DocumentID in the source document (other database) in a computed when composed field and transfer this value to the target document. After transfering the value (the DocumentID) I can use this with the GetDocumentByID command to open the document...

Greetings,

Bob
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6173194
Try this in a button

dim ws as New NotesUIworkspace
dim doc as NotesDocument
dim db as NotesDatabase

set db = New NotesDatabase( Server, File )
set view = db.GetView( "<viewname>" )
set doc = view.GetDocumentByKey( "<Key to Document>")
If not doc is nothing then
call ws.EditDocument( True, doc )
end if

0
 
LVL 1

Author Comment

by:oosterbaan
ID: 6173519
Thanks HemanthaKumar,

Thanks for your code....

Can you help me out to modify your code ? I like to change a few things (if it is possible) ?

- The server and filename are in a variable (a field on the document) and is it possible to use a replicaID instead of the server and filename ?

- The "Key to Document" is also present in a field on the document. Is it possible to use this, and how is the syntax in that case ?

- I suppose that the line "call ws.EditDocument(True,doc) will open the document in editmode. I like to have it openend in readmode. The user who will click this button will only have read rights on this database....

Thanks....

Greetings,

Bob

0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6174176
This is the modified code, with replicaid and key from uidocument

dim ws as New NotesUIworkspace
dim note as NotesDocument
dim doc as NotesDocument
dim db as New NotesDatabase( "", "" )

set note = ws.CurrentDocument.Document
If db.OpenByReplicaID( note.Server(0), note.ReplicaID(0) ) Then

set view = db.GetView( "<viewname>" )
set doc = view.GetDocumentByKey( note.Key(0) )
If not doc is nothing then
call ws.EditDocument( FALSE, doc ) ' opens in read mode
end if
End IF

0
 
LVL 1

Author Comment

by:oosterbaan
ID: 6176604
Thanks Heman~

When using your last code, I get a error saying:

"Invalid replica id (<ReplicaID that's in the field>)"

It's a computed by composed field and set OK, because I'm using this field also for a @DbLookup in this database.

If you have not any idea what this can be, please change your code using the database filename in a variable instead of a ReplicaID. I can use this also....

Greetings,

Bob
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 75 total points
ID: 6178169
I hope the format of replicaid is wrong it should not be like
"85255FA9:00747B84", instead it should be like this "85255FA900747B84".

Convert the value into text type by either using @text in the default value of the replica id field

or


Use this

dim ws as New NotesUIworkspace
dim doc as NotesDocument
dim db as NotesDatabase

set db = New NotesDatabase( note.Server(0), note.File(0) )
set view = db.GetView( "<viewname>" )
set doc = view.GetDocumentByKey( note.Key(0) )
If not doc is nothing then
call ws.EditDocument( FALSE, doc ) ' opens in read mode
end if

~Hemanth
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

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
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

756 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