Solved

Document link problem....

Posted on 2001-06-09
9
392 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
  • 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

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

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…
  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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

12 Experts available now in Live!

Get 1:1 Help Now