Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Document link problem....

Posted on 2001-06-09
9
Medium Priority
?
422 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 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
Technology Partners: 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 300 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
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…

718 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