@DbLookup(class : "NoCache" ;"":Sys_SYSDB;"v_Info";applyname;4);
Sys_SYSDB 变量
applyname变量
在lotus Script 如何写? 真心累。。
这种问题,你应该仔细看下帮助,各个参数都写得非常详细。
@DbLookup是公式Formula Language。applyname变量应该是你要查询的值。你可以很简单的看成字符串。
LS执行公式
Evaluate({@DbLookup(“”: "NoCache" ;"":Sys_SYSDB;"v_Info";"}+applyname+{";4);})
@DbLookup (Domino data source) (Formula Language)
Given a key value, looks in the specified view (or folder) and finds all documents containing the key value in the first sorted column within the view. For each selected document, @DbLookup returns either the contents of a specified column in the view, or the contents of a specified field.
Syntax
@DbLookup( class : cache ; server : database ; view ; key ; fieldName ; keywords ) or @DbLookup( class : cache ; server : database ; view ; key ; columnNumber ; keywords )
Note: The separator between the class and the cache string arguments as well as the server and database are colons; the rest of the separators are semicolons.
Parameters
class
Text. Indicates what type of database you are accessing. You can indicate a Domino® database with either "" or "Notes®."
cache
String argument. Optional. In the initial lookup, specify either "" or "NoCache." If the former case, subsequent lookups to the same data source, you can specify "ReCache."
•"" (null string) caches the results of the lookup. Each subsequent lookup to the same location (within the same Domino session and so long as the database executing this lookup remains open) reuses that data until you specify "ReCache." Cached data improves performance and may be a good choice for stable data.
•"ReCache" refreshes the cache with the latest data from the database. If you want to ensure that this lookup gets the latest information, specify this option.
•"NoCache" gets the results of the lookup from the database; no cache is used. If you want to ensure that Domino retrieves the latest information for every lookup, specify this option.
Note: "NoCache" ignores the lookup cache. If the same lookup was already cached, the cache is not updated. "ReCache" does not use the cached result, it stores its result in the cache when it is done. If you later do the same lookup with default caching, you get the result that was stored by "ReCache."
server : database
Text list. The server location and file name of the database. See "Specifying the server and database."
view
Text. The name of the view or folder in which to search. The view name must exactly match the view's full name as specified in the view InfoBox (you can omit any synonyms). If the view cascades from another name on the menu, include that name too. See "Specifying the view."
key
Text, number, date/time, or a list of any of these types. Determines which document is actually read in order to retrieve a value. A document's key is the value displayed in the first sorted column within the view. Note that if the column is re-sortable, results will depend on the current sort order. See "Specifying a key."
fieldName
Text. The name of the field from which the data will be retrieved, once the correct document has been identified. See "Specifying a field name."
columnNumber
Number. When you use a column number, Domino finds all documents in the view that match the specified key, and returns whatever value is displayed in the indicated column for each of those documents, regardless of the formula used to display the data. See "Specifying the column number."
keywords
Note: This parameter is new with Release 6.
Keyword. Optional. Keywords can be concatenated.
•[FAILSILENT] returns "" (null string) instead of an error if the key cannot be found.
•[PARTIALMATCH] returns a match if the key matches the beginning characters of the column value.
•[RETURNDOCUMENTUNIQUEID] returns the UNID of the document instead of a field or column value.
Return value
valuesFound
Text, numbers, date-time, or text-list. The values found in the fieldName or column you indicated, or the UNID of the document. See "Accessing the return values."
If no documents in the first sorted column match the key, @DbLookup returns an error, "Entry not found in index", which you can test for with @IsError or @IfError.
Specifying the server and database
There are several ways to specify the server : database parameter:
•To perform the lookup on the current database (the same database in which the formula is being evaluated), specify "" as the entire argument to the function. "" means the local Domino directory where you are executing.
•To perform a lookup on a local database, use "" for the server name and specify the database name explicitly, such as "":"DATABASE.NSF."
•To perform a lookup (from the workstation) on a Domino database that resides on a server, include the server plus the path and file name as a text list, as in "SERVER":"DATABASE.NSF."
•If there are multiple copies of the database located on various Domino servers, using the database replica ID in place of both the server and database name lets you access a replica copy of that database without having to specify either the server name or the database name. For example, if you use "85255CEB:0032AC04" (a database replica ID, found in the database InfoBox) as the database name, Domino uses a replica of the database to retrieve the information.
Domino searches for replicas in this order, using the first replica it encounters:
◦Workspace
If there is one replica on your workspace, Domino uses it.
If there are multiple, stacked replicas on your workspace, Domino uses the first replica on the stack.
If there are multiple, unstacked replicas on your workspace, Domino looks for an icon matching your current server and uses that. If none of the icons matches your current server, Domino uses the icon that was added to your workspace first.
◦Current® server
◦Locally (your hard disk)
Once a replica is located, it's added to your workspace to save time on future lookups.
Notes
•To avoid typing errors in the replica ID, choose File - Database - Design Synopsis and select Replication. Then copy the replica ID from the synopsis and paste it into your formula.
•If your database is located in a DOS or OS/2 subdirectory, such as MAIL\MINE.NSF, put a double backslash between the directory and the database name, as in "MAIL\\MINE.NSF" because formulas treat single backslashes as escape characters.
Specifying a view
You can specify a view parameter using either the full name of the view (or folder) or its synonym. For example, if your Last Name view is cascaded from By Author in the View menu, and has the synonym |LName, it looks like this in the view InfoBox:
By Author\Last Name|LName
When you reference this view with @DbLookup, you can just use the LName synonym, enclosed in quotation marks:
"LName"
If the view name doesn't have a synonym, you use the By Author name plus the Last Name cascade, again enclosed in quotation marks (but without the synonym). And since the view name is used in a formula, the "\" must be preceded with an additional "\" to ensure that Domino interprets it correctly:
"By Author\\Last Name"
Specifying a key
You can only test for values that match the key (equality); there is no way to specify a different operator such as < (less-than).
In addition to specifying a constant as the key to be matched, you can also use the value of an editable field. For example, you could create a ContactInfo form that contains two fields: a contactName field and a lookupComments field. You want a user to be able to enter a contact name in the contactName field and have the lookupComments field display a list of comments associated with the contact that the user supplied. To do so, you could make the contactName field an editable text field (or a choice list field such as a Dialog list field). The lookupComments field could contain the following code as its Input validation formula:
@DbLookup("":"NoCache";"Sales":"Customers.nsf";"ContactList";contactName;"Comments")
When a user enters or chooses the customer name, "Susie Queue," for instance, in the contactName field of the ContactInfo form and presses F9 to refresh the document, the formula in the lookupComments field performs these tasks:
•Finds the ContactList view of the Notes database Customers.nsf on the Sales server.
•Locates the first sorted column containing the key "Susie Queue."
•Extracts the text strings displayed in the Comments column for each document containing the "Susie Queue" key.
•Returns the extracted list of comments to the lookupComments field. If more than one document was accessed, the strings returned are separated by a semicolon.
By specifying the field contactName as the key, whenever the @DbLookup formula is executed, the current value of the contactName field is used as the lookup criterion.