Building Dynamic Domino Urls

Building Dynamic Domino Urls

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.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

signs and ";
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 := "[&LTa href=" + tURL + ">]" + tAnchorText + "[</a>]";

REM "Display the hotspot, with bold on, in the column";
"[&LTb>]" + tHotSpotURL + "[</b>]"

This was first published in November 2000

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.