serverlookup(
DATABASE
,
KEYFIELD
,
KEYDATA
,
DATAFIELD
,
DEFAULT
,
LEVEL
)

The serverlookup( function searches a shared database for a value, then returns other information from the same record. Similar to the lookup( function, but the search is performed on the server instead in the local computer’s memory.


Parameters

This function has six parameters:

database – is the shared database that will be searched. This database must be currently open, and it must be a shared database. If this parameter is "" then the current database will be scanned.

keyfield – is the name of the field that you want to search in. For example if you want to look up all checks written to a certain vendor, this should be the field that contains vendor names. The field must be in the database specified by the first parameter. (Note: For compatibility with older versions of Panorama, you are allowed to quote this parameter but quoting is not necessary.)

keydata – is the actual data that you want to search for. For example if you want to look up all checks written to a certain vendor, this should be the actual vendor name. This parameter is often a field in the current database, but it could also be a variable, a constant, or a general expression.

datafield – is the name of the field that you want to retrieve data from. For example if you want to retrieve check numbers, this should be the name of the field that contains check numbers. This must be a field in the database specified by the first parameter.

default – is the value you want this function to return if it is unable to find the information specified by the keyfield and keydata parameters. The data type of the default value should match the data type of the datafield. If the datafield is numeric, the default should usually be zero. If the datafield is text, the default should usually be "". Note: This parameter is optional. If it is omitted, the lookup( function will return an error if the search fails.

level – is the minimum summary level to be searched. Usually this parameter is zero so that the entire database will be searched. If the level is set to 1 through 7, only summary records will be searched. Note: This parameter is optional. If it is omitted, all records will be searched.


Description

This function searches a shared database for a value, then returns other information from the same record. This is nearly identical to the lookup( function, but the search is performed on the server instead in the local computer’s memory. This means that this function will always return the most up-to-date information, even if that information hasn’t been synchronized to the local computer yet. In fact, the only difference between this function and the lookup( function is whether the search is conducted locally or on the server, so please see the lookup( function to learn the exact details of using this function.

Important Note: Since accessing data on the server is much slower than accessing it in the local computer memory, this function will be much slower than using the lookup( function. You should only use the serverlookup( function when you absolutely need the most up-to-date information, no matter what the performance cost. You must NEVER use this function in a situation where it will be used repeatedly, for example when using a select or formulafill statement.


See Also


History

VersionStatusNotes
10.2NewNew in this version.