DB query action
Add a DB query action for a form or form controls such as drop-down lists or text boxes to add or manage database records.
Use the DB query action to point to the required database and design access for operations such as View, Add, Update and Delete. For example, you can interact with the Customer table in a database to display the customer name in the Name box on a Customer Details form.
You can use the DB query action to add multiple records at a time, search for records with similar values, and use stored procedures.
Before you can create a DB query action, you must set up a database connection string. See Set up a database connection string.
Additional Information
The following sample data values can be provided:
-
All numeric types = -1
-
Dates = 01/01/1900
-
Byte = 0
-
String = Blank String
-
Boolean = False
-
On the form modeling bar, click
Actions and click
New.
The New action dialog box is displayed.
- On the Type list, select DB query.
- Change the default Name (DBQuery1) to something meaningful.
- Optional. Select Multilingual to configure a unique action for each language separately. See Configure multilingual actions.
-
Create the DB query. You can create a DB query for the following:
Once a query is created, it appears in the Query box.
-
The connection string is case sensitive.
-
You can whitelist a database connection string. If the Allow all setting under System > System settings > System > Whitelist is not enabled, you can only use the whitelisted database connection strings. See Configure the server URLs and database connection strings.
-
-
Click
Save.
The newly created action is added to the table.
-
Associate the action with the control to trigger this action. See
Configure actions for form control
events. Alternatively, to call this action for a form event, associate the action with the form. See
Associate an action with a form.
When this action is triggered, the relevant action is performed based on the DB query.