A background lookup requests data from a database or LDAP connection and automatically retrieves data from a specified data source without any interaction expected from the user. A common use for this type of lookup is the loading of list or drop-down options taken from a system database. Also, data can be passed from an app to a database connection to act as a filter which is expected to return a single record of data to populate specific app fields.
The following steps apply to an example app with a Search button and three fields: Order Number, Order Date and Customer ID. The expected behavior is that the user must enter a valid order number and then click Search to retrieve order details and fill the other app fields.
1.Select the Search button object on the app. 2.On the Properties panel, select the Button Is Pressed behavior. The system switches to Behavior view. 3.In the Integration Commands section of the Toolbox, select the Connect command and drag it onto the behaviors canvas. 4.In the Properties panel, select a connection from the Connections list. 5.Now select an Action belonging to that connection from the lower list. For more information, see Defining Connection Actions. 6.The Send Parameters will then list all fields that the app can send to the action (in this case the action is a lookup). 7.Find the data source parameter in the Send Parameter Name column that you will use to search for a specific data record. (ID in the example). Click in the Source column and find the field within the app that holds the data to used. In this example, this will now pass the customer id through to a SQL statement with that id automatically inserted into the WHERE clause. 8.Now specify the Return Parameters. Find the data source fields in the Name column from which the data is being returned. Click in the Target column and find the app fields that should receive the returned data (Customer Name and City in the example below). If you do not need to populate a specific field, just leave it empty. 9.Select Preview from the App menu to test the lookup. |
See also: Setting Up Popup Lookups
Return to: Calling the Connection from an App, Integration