Link by key works for http: but not Notes: URL

I have a Notes URL in the browser that is supposed to open the document based on a key:

notes://server/database/view/key?openDocument

When I try to access the URL I get the following error:

The document specified by the link cannot be located within the linked-to database.

What is strange is that I have a different view that does not work but I get a totally different error.

Invalid or non existent document.

Both errors occur in the client. Both links work just fine using an http url.

I found this link in a search:

https://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/6911347587a73c1c85257130003d408e?OpenDocument

Are there any other solutions other than to use the UNID???

Subject: Link by key works for http: but not Notes: URL

I solved this problem recently with a small agent that simply does a lookup followed by a redirection:

Agent “notesOpen” :

Code:

Sub aaNotesOpen()

'/**

’ * Implementation for agent ‘notesOpen’.

’ * Handles web URLs like

’ * http://server/demo.nsf/notesOpen?OpenAgent&key=B92BE8EB8A68AAD4

’ * and redirects to a notes: URL, so the document gets opened in the Notes Client.

’ *

’ * The reason why this is needed is, that ‘notes:’ URLs only work with UNIDs.

’ * It is not possible to use a custom view and a custom key.

’ * (Although this would work with ‘html:’ URLs.)

’ */

Const title = "aaNotesOpen"

Dim cs As New CCallstack (title)

On Error Goto CATCH



Dim s As New NotesSession, query As String

query = s.DocumentContext.QUERY_STRING_DECODED(0)



Dim key As String, docAction As NotesDocument

key = getUrlParameter (query, "key", "")



If key<>"" Then

	Set docAction = getNodeByKey (key) ' lookup the document

End If

If docAction Is Nothing Then

	Print {<h1>ERROR: Invalid Key</h1>}

	Print {<p>The action key '} & key & {' could not be found.</p>}

Else

	' redirect to a notes: URL like

	'    notes://Devserver3@INTEGRAL/__C125729600594C81.nsf/0/B92BE8EB8A68AAD4C125734D00335ED1?OpenDocument

	Print "[" & docAction.NotesURL & "]"

End If



Exit Sub

CATCH:

Call logException()

Exit Sub

End Sub

Note that this not very fast, since the client browser is involved, so if anybody has a better solution…