Since, well, like “ever”, it’s possible to open a Notesdocument in the browser by using the first sorted column in a view as the key. Something like:
Since a couple of years, we can also use notes://-links. Very neat if you want to open a database, view or document directly in Notes. What if you want to use a key in a view for opening a document in Notes?
… doesn’t work.
After spreading my wings on the web, I found:
The OpenDocumentByKey command was added in Notes 8.5 to support the ability to open a document by specifying a view and a key within that view. The definition of key is the same as the Domino server uses in here as used in the OpenDocument method. The client preferred to be more explicit by creating a new command to prevent conflicts that could occur with certain keys and document identifiers.
Great! It may be working within their acne domain, but it certainly doesn’t work overhere! “The document specified by the link cannot be located within the linked-to database.” And the fix is deferred to a future release.
We have 2 options: say to our client that IBM knows about the problem and that a fix is deferred to a future release (sorry for that) OR we create a simple alternative.
I created a page notesredirect: it redirects a http url to a notesdocument link. I like simple namings :-). There’s a computed field on it that does a @DbLookup in the sorted view, using the key you initially wanted to use.
Follow these steps:
- Create a page notesredirect (or whatever name you prefer) and set it as pass through.
- Write some simple html that does the redirecting:
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="refresh" content="0; url=<Computed Value>">
- For the computed value:
- Create a page refnotfound to show an error page to the user if for some reason a document could not be found.
- To use it, you need to create your url in this form:
It’s not high-tech and it’s old school, but it works :-).