Domino Code Fragment

Code Name*

Formula lookup for frequently changing data
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.149.234.141
Description*
Problem: You have some data on a document that you are looking up from another. The data changes frequently and is difficult to keep synchronized. Solution: Instead of trying to manipulate the data each time it changes for hundreds of documents, make your lookups dynamic. However, lots of dynamic lookups will slow your application. Instead use this technique.
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:

Create a popup around some text or graphic that lets the user know what data you will process. Then do your lookups in a popup formula like this one that shows owner, location and cost center for items in a fixed asset system:

REM "add some space to each line because the popup default format is ugly.";
SP := @Repeat(" "; 3);


REM "get the data";
OWN := @DbLookup("" : "NoCache"; ""; "SYS"; SystemNumber; "Owner");
LOC := @DbLookup("" : "NoCache"; ""; "SYS"; SystemNumber; "Location");
COST := @DbLookup("" : "NoCache"; ""; "SYS"; SystemNumber; "CostCenter");


REM "format the popup";
REM "the extra line at the beginning and end also improve the look of the popup";
@NewLine +
SP + "Owner: " + @If(@IsError(OWN); ""; OWN) + SP +
@NewLine +
@NewLine +
SP + "Location: " + @If(@IsError(LOC); ""; LOC) + SP +
@NewLine +
@NewLine +
SP + "Cost Center: " + @If(@IsError(COST); ""; COST) + SP +
@NewLine;