Making Databases Interactive

Once you have set up a connection to a Database in Opus using the Database Query action, you will want users to be able to move between records in the Select List created. The Showing Records from a Database section described how you can display a record to the user on a page. This section describes how you can go to the next record in the Select List.

Opus Pro provides a variety of Database actions that let you interact with the selected records from a database – see Introducing the Database Actions for more information. The following steps will show you how to create a Next Record button on a page, which will get the next record from the Select List whenever you click on the button.

Note:
You can use the same steps to create a Previous Record, First Record or Last Record button on your page using the appropriate Database actions.

Create a Next Record button:

  1. Create a new Button object on the same page as the Text objects containing the record information, as described in the Showing Records from a Database section.

Note:
A Left Mouse Click trigger is automatically selected for Button objects, so you wont have to add it. Alternatively, you can add a different trigger if required.

2. Select the Database menu from the Actions tab.

3. Add the Next Record action to your trigger, as described in adding actions. The Next Record tab will automatically appear when you add the action.

4. Click on the down arrow to the right of the Query box to open a list of query’s you have previously created in this publication.

Note:
If the drop down box is empty, you have not previously entered a Database QueryActions_Database_Query action to this publication. You must have created at least one Database Query action in order for this action to work.

5. Click on the Apply button to save your changes.

  1. And you have finished!

How it works is that when the user clicks on the button, the Next Record action is activated. The system will look up the query you entered in the Next Record tab and find the next record in the list. It will then update the variables displayed on the page with the data from the fields of the next record. Each time you press the button, the next record in the query is displayed. If the current record displayed on the page is the last record in the query then nothing will happen.

Related Topics:

image\SHORTCUT.jpg%Actions_Next_Record The Next Record actionActions_Next_Record

%Databases:_Showing_Records Showing Records from a Database in OpusDatabases:_Showing_Records

%Actions_Database_Query the Database Query actionActions_Database_Query

%Databases:_Overview Working with Databases - OverviewDatabases:_Overview

%Introducing_the_Database_Actions Introducing the Database ActionsIntroducing_the_Database_Actions