serverlookupall(
DATABASE
,
KEYFIELD
,
KEYDATA
,
DATAFIELD
,
SEPARATOR
)

The serverlookupall( function builds a text array containing one item for every record in the target database where the data in the keyField matches the keyData. Similar to the lookupall( function but retreives the data directly from the server computer, instead of from the local computer’s memory.


Parameters

This function has five parameters:

database – is the database that will be scanned. This database must be currently open. If this parameter is "" then the current database will be scanned. Note: The lookupall( function will scan every record in the database, including records that are not currently selected. If you want to build an array from only selected records, use the arrayselectedbuild( function.

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, however, 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. Note: This function can optionally handle multiple data fields, with a separator, see below for further information.

separator – is the separator character for the text array you are building (see Text Arrays).


Description

This function creates a Text Array by scanning the contents of a database looking for records where the keyField matches the specified keyValue. 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.


Note: To learn more about the theory and technical details about working with links between databases, see Linking with Another Database. The lookupall( function can also be constructed automatically for you with the Relational Workshop wizard.


To illustrate this function, we’ll assume that we have two databases, Vendors and Checkbook. The Vendors database contains a field named Company that lists each company. The Checkbook contains fields for CheckNumber, Date, Payee (the name of the company each record was written to, and Amount. Within the Vendors database, this formula could be used to display all the checks written to the currently selected company. (For example, you could use this formula in a Text Display Object).

"Checks written to "+Company+": "+
    serverlookupall("Checkbook",Payee,Company,CheckNumber,", ")

The output of this formula will be something like this:

Checks written to Acme Services: 384, 502, 615, 789

Note: Unlike the lookupall( function, this function only allows one data field to be specified, not multiple data fields.


See Also


History

VersionStatusNotes
10.2NewNew in this version.