Domino Code Fragment

Code Name*
Using @Prompt and @DbLookup to simulate @Picklist but only on a subset of documents
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.217.109.151
Description*
We have a view in a seperate database whose first column is $Ref. We want to pull a only those documents matching the parent I.D. that we pass but want to display to the user something readable. So we use Concatenated DbLookups in an @Prompt to let the user see the name they wish to select. We then parse out the selected documents I.D. so we can pull in its data in PostOpen code.
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
REM "Here we are setting a field SelectedReplica_ID on the profile document to the value of the document I.D. we ";
REM "selected from Sicav Tracker so as to use this value in our lookups to retrive all of the documents data in our";
REM "PostOpen Event";


server := @GetProfileField("DeveloperProfileKeyValues"; "dbServer3");
database := @GetProfileField("DeveloperProfileKeyValues"; "Databases3");
view := @GetProfileField("DeveloperProfileKeyValues"; "LookupBrokerID");
REM "NOTE: There must be a value stored in the below called field";
BrokerID := @GetProfileField("DeveloperProfileKeyValues"; "SelectedReplicaID");
LName := @DbLookup( "":"NoCache" ; server : database ; view ; BrokerID; 3);
RName := @DbLookup( "":"NoCache" ; server : database ; view ; BrokerID; 4);
DocID := @DbLookup( "":"NoCache" ; server : database ; view ; BrokerID; 2);


REM "Now that we defined our variables we allow the user to select this companies brokers";

SelectedDoc := @Prompt([OKCANCELLIST];"Select a Broker"; "Select a broker to add"; " ";LName + ", " +RName + ": " +DocID);

@SetProfileField( "DeveloperProfileKeyValues" ; "SelectedReplicaID_1" ; @Trim(@Right(SelectedDoc; ":")))