Autofill Handler Setup

An Autofill Handler maps a form to its corresponding Autofill Query and Data Source, connecting all the components together to enable the Autofill process. When invoked, the Autofill Handler uses its Data Source to connect to the external database, retrieves data from the database using its Autofill Query, and finally places the retrieved data into the form.  An Autofill Handler determines the behavior of an Autofill operation.

 

The final step in setting up a form for automatic population from a database is uploading an Autofill-designed form into the Formatta E-Forms Manager catalog and configuring one or more Autofill Handlers.

 

Using the Autofill Handler Setup Wizard

In the Autofill Handlers section of the Autofill tab, click the New Autofill Handler link. This will launch a wizard where you will set up the first Autofill Handler for the form. The screens of the Autofill Configuration Wizard will prompt your for basic information about the handler. Navigate through the wizard using the Next, Back and Cancel buttons. Use the fields as described below.

Handler Definition Screen

Complete the fields in this screen, then click the Next button to continue.  This screen prompts you for the following data:

 

 

 

 

 

 

Note: A pop-up list can only be used in an Autofill Handler with a Remote Command action type.

 

 

 

Data Source and Query Selection Screen

On the second screen of the Autofill Configuration Wizard, you must specify the Data Source and the Autofill Query that will be used by the Handler.  The Data Source you select will determine which database the Handler will connect to, and the Query determines the result set that will be returned for form population.

 

The list of Autofill Queries displayed here will only show query definitions with result set types that are appropriate to the type of Autofill you chose on the previous screen.  For example, if on the previous screen you specified a Direct-to-Form Autofill type, then only queries that are defined as returning a single record will be shown in the Autofill Query list.

 

Autofill Type-Specific Settings Screen

If chose a Listbox Field or Pop-up List Autofill type on the first screen, then you will see this screen, which prompts you for additional information that is specific to the Autofill type.  Below are descriptions of each:

Listbox Field

If you chose "Listbox Field" as the Autofill Type, you need to specify the name of the form field that will be populated with list contents from the database.  The field you choose must be a combo box field type in the form.

 

Pop-up List

If you chose "Pop-up List" as the Autofill Type, you will need to provide information about the pop-up list presented to the user for selection of a query result in the following fields:

 

 

 

Query Column to Form Field Mappings Screen

If you chose the "Direct-to-Form" or "Popup List" type of Autofill, the final screen of the Autofill Configuration Wizard will prompt you to map columns from your query to fields in the form.  

 

The following information may be helpful when using this screen:

 

 

 

 

To create the mapping of SQL query results to form fields on this screen:

 

  1. Select a SQL query result column from the Query Columns list on the left.

  2. Select a form field from the Form Fields list on the right.

  3. Click the Map button in between the two lists.

 

By following the three steps above, a mapping will be placed into the list on the lower half of the screen.  To remove a mapping from this list, you may click the Delete icon in the row you wish to delete.  This will place the mapped form field back into the list so that it may be re-mapped if you wish.

 

Mapping Fields for Tabular Autofill

If the Autofill Query chosen in the second screen is Multiple-Repeating results Autofill Query, and the form contains a Table control (or otherwise specially-named group of fields), the Form Fields list in this section will show field names with the # symbol at the end.  This indicates that each item in the list represents a whole set of fields that can be mapped to for tabular Autofill.  For more information on this, see Using Autofill for Tabular Data.

 

Enabling Autofill

Once you have set up your Autofill Handlers, you need to enable them for your form. After closing the Autofill Configuration Wizard, you will return to the Autofill Tab of the Form Management Properties under the Catalog tab.

 

1. In the General Settings section, check the Enable Autofill box.

 

2. Click the Save Changes button.

 

3. In the Autofill Handlers section, check the box next to the handler you wish to use.

 

4. Click the Enable Selected button.

 

5. To disable a handler at any time, check the box next to the handler you wish to disable and click the Disable Selected button.

 

Once you are finished configuring your Autofill Handlers, you will be ready to use Designer to define field sets and add handler calls to your form.