API
@-Formulas
JavaScript
LotusScript
Reg Exp
Web Design
Notes Client
XPages
 
Computed Links In ND6
Since the Notes/Domino 6 (ND6) client now recognizes HTML, you can compute links inside <A HREF> tags, which will be recognized by both the Notes client and web browser. Basically what you want to do is create some computed text with pass through HTML enabled. You cannot use computed for display fields - those always result in text, no matter if the pass through HTML setting is enabled or not.

So, go into your page or form (this will work in either design element). Enable pass through HTML by going to the Text menu, then choosing Pass-Thru HTML. Then create your computed text by going to the Create menu, then choosing Computed Text. You can change the font or color of your computed text (it's easier to find later on if you do), but the formula is where all the "magic" happens.

Your formula should compute all the HTML needed to build links. For example, let's say you have a view (it's alias is "vwLinks") with 2 columns. Column 1 is the title (name of the link) and column 2 is the document unique ID. You're going to want to build the <A> tags so the Notes client will open the pages in Notes, so we'll need to specify the protocol in the URL to be opened. If the protocol is omitted the page would be opened in a brower (because HTML is being used). Since the protocol is being used, we need to specify the full URL, including the server. For a browser, we can omit the protocol and just start with the database path. Everything else is the same from the browser to Notes. So let's take a look at some sample code:

LookupTitlesStep1 := @DbColumn(""; ""; "vwLinks"; 1);
LookupTitles := @If(@IsError(LookupTitlesStep1); ""; LookupTitlesStep1)
LookupUNIDsStep1 := @DbColumn(""; ""; "vwLinks"; 2);
LookupUNIDs := @If(@IsError(LookupUNIDsStep1); ""; LookupUNIDsStep1)
Check := @If(@Elements(LookupTitles) = 0 | @Elements(LookupUNIDs) = 0 | @Elements(LookupTitles) != @Elements(LookupUNIDs); @Return(""); 0);
FirstPart := @If(@IsMember("$$WebClient"; @UserRoles); ""; "notes://" + @ReplaceSubstring(@Name([CN]; @DbName[1]); " " : "\\"; "+" : "/"));
List := "<a href=\"" + FirstPart + "/" + @WebDbName + "/0/" + LookupUNIDs + "\">" + LookupTitles + "</a>";
@Implode(List; "<br />")

Wow, there's a lot of new R6 stuff in there. First, we're using the new ability to get a subset without using @Subset. We get the first part of the database name - the same as @Subset(@DbName; 1). Finally, we use @WebDbName instead of the trick of doing all the replace substrings (which we still have to do on the server name since we're specifying the full URL). The rest of the functions have been around for a long time.

This computed text builds all the HTML for a bunch of links. Since pass through HTML works in the client (if the form/page property "Render pass through HTML in Notes" is enabled) there will be links in both the ND6 client and in the browser. And the links will work and open up the documents in read mode in both environments.