Creating and managing layouts and reports > Working with portals on layouts > Adding Add-on Tables to custom apps
 

Adding Add-on Tables to custom apps

After you create a custom app, you can extend what it can do by adding an Add-on Table to display related records from a new table. Add-on Tables add a table with a predefined set of fields to your custom app. For example, the Phone Numbers Add-on Table adds a table with fields for phone number and type. In addition, a relationship is created between the new table and the current table.

Example

To track multiple file attachments related to each record in your custom app, first draw a portal on an existing layout. Then in the Portal Setup dialog box, choose the Attachments Add-on Table. As shown in the illustration below, choosing an Add-on Table adds the portal along with field and button objects to your layout, creates a new table to store the attachment information, relates the new table to the current table, and adds scripts used on the layout.

In Browse mode, the portal allows you to insert a file into the Attachment field and enter a description for each related attachment.

Drawing a portal and choosing to show records from an Add-on Table adds a portal, a table, fields, and scripts to your custom app

To add an Add-on Table:

1. In Layout mode, switch to the layout where you want to display records from an Add-on Table.

The layout must be based on a table that has a primary key field (see note below).

2. Click the Portal tool Portal tool in the status toolbar.

3. Position the crosshair pointer on the layout where you want the portal to begin, then drag the pointer diagonally.

4. In the Portal Setup dialog box, for Show records from, choose New Add-on Table.

If New Add-on Table is not available, the table that the current layout is based on has no primary key field (see note below).

5. Choose an Add-on Table, then click Choose.

6. Enter a name for the new table that will be added.

If your custom app already has a table based on the same Add-on Table you chose above, you see the Specify Table dialog box. Either choose an existing table and click Choose or enter a different name for the new table and click Create.

A portal and New related record button button (for entering a new related record) appear on the layout. You can move and resize these objects. See Moving objects on a layout and Resizing and reshaping objects.

Notes 

You can add Add-on Tables to a custom app if the table that the current layout is based on has a primary key field that meets one of the following criteria:

the field uses an auto-enter serial number

the field uses an auto-enter calculation that includes the Get(UUID) or Get(UUIDNumber) function

the field is a stored calculation field that includes the Get(UUID) or Get(UUIDNumber) function

See Defining automatic data entry and Defining field indexing options.

The People Add-on Table adds more to your custom app than other Add-on Tables, such as a join table (for a many-to-many relationship between the current table and the People table), list and details layouts, and buttons that let you add people and choose people from a list.

Related topics 

Selecting and working with portals

Creating a FileMaker Pro Advanced file