Using a data connection resource on a form

About this task

Example

In order to establish a connection to an external data source, you must first enable external connections for the database. Then you define a data connection resource (DCR). To use this resource to establish a link between Notes® and an external application, you use the DCR in a form. You define fields on the form that map to the data you are retrieving from the external application. When you define a field, you mark it as an external data source and associate it with the DCR.

To specify a default data connection for a form

About this task

If you are planning to use a DCR in more than one field on a form, you can specify a default data connection, and, optionally, a default metadata object such as a table or view. When you create a field for use with an external data source, the default information for the data connection is supplied automatically. You can overwrite the default DCR with a different DCR if you wish.

Procedure

  1. Create or open a form.
  2. Choose Design - Form Properties to display the properties box.
  3. Click the Defaults tab.
  4. In the "Data Source Options" section, you can browse for a data connection resource or enter the name in the "Default Data Connection" field.
  5. Optional: Specify a "Default metadata object," such as a table or view name, from the external application.

To create fields for connecting with external data

Procedure

  1. Select the field you want to associate with an external data source.
  2. Choose Design - Field Properties to display the Field Properties box.
  3. Click the Info tab and select "External data source."

    If you have specified a default DCR for the form, the information is applied to the field.

  4. In the "Data Source Options" section, browse for or enter the name for the metadata object name and the corresponding external field. Note that if you are developing an application locally, you will not be able to browse external metadata. The type of field in the metadata -- for example text or integer -- is indicated by an icon.
  5. Specify an existing data connection resource.
  6. Check "Key field" if this field corresponds to a field in the external application that you want to designate as the key field. Every data connection requires a key field -- the key field is the link between the form and the back-end database or application. Note that key fields are always stored locally as well as on the back-end.
  7. Optional: If you want data from fields other than the key field stored locally, mark each of these fields as a Data field and select the "Store locally" option. For these fields, data will be stored in the Domino® database as well as in the back end database. Changes you make in the Domino® database are pushed back to the back end database. If the back end changes, you can manually refresh the Domino® database by pressing F9 with the document open or by closing and opening the document.