You want to make your Domino URLs generic when they are coded in the design of
the Notes database. This will help to improve the maintainability and
portability of a Notes database as server names, database names, and view names
will not be hard coded in the design of the database. This formula can be used
in any Notes design element as required.
Following is an example of how to build a dynamic hotspot Domino URL for each
Notes document listed in a view designed for use on the Web only. This code
would be put in one of the columns of the view. It is used when you want to
override the default HTML link that is built by Domino which uses the first
data column in the view. For example you want the document title, which is the
third column in the view, to be the HTML link not the first column in the view,
which is a date value.
Note: The only one-time customization required each time this formula is used
is to review the "tAnchorText" value and revise it as required to provide the
text that is to be displayed for the URL hotspot. This example uses the
'Subject" field for the hotspot anchor text.
tFwdSlash := "/";
tBackSlash := "\\";
tSingleQuote := "\'";
tDoubleQuote := "\"";
REM "Get the name and relative path for the database, ";
REM " replacing spaces with plus
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
REM " replacing back slashes with forward slashes. ";
tDb := @ReplaceSubstring(
@ReplaceSubstring
(@Subset(@DbName; -1);
" "; "+");
tBackSlash; tFwdSlash);
REM "Get the current view right most alias name, ";
REM " replacing spaces with plus signs. ";
tView := @ReplaceSubstring
(@Subset(@ViewTitle;-1);
" "; "+");
REM "Get the Notes Document ID";
tDocID := @LowerCase(@Text(@DocumentUniqueID));
REM "Specify the Domino Web action";
tAction := "?OpenDocument";
REM "Specify the anchor text for the hotspot";
REM "This should be computed using one or more fields on the document";
tAnchorText := Subject;
REM "Create the URL";
tURL := tDoubleQuote + tFwdSlash + tDb + tFwdSlash + tView + tFwdSlash + tDocID
+ tAction + tDoubleQuote;
REM "Create a hotspot for the URL";
tHotSpotURL := "[<a href=" + tURL + ">]" + tAnchorText + "[</a>]";
REM "Display the hotspot, with bold on, in the column";
"[<b>]" + tHotSpotURL + "[</b>]"
This was first published in November 2000