Overview
Wayfast Actions allow executing process or communicating with external systems incluiding databases, APIs or executing DLL methods. In this lesson we will review how to create an action to save data in a table with a Stored Procedure.
Step 1: Create a Table
Open SQL Server Management Studio and run the following script:
...
A popup is displayed, click on “Synchronize” button. Now the stored procedure created in database will be available to connect with dataset.
...
Step 2: Setup the page (IN REVIEW)
Before creating an action we need to create a page with the following controls:
...
Turn to Layout tab and establish the order to display this control. We are going to place it next to the inputboxes. Click on “Submit” button
...
How to add Actions in Controls?
Wayfast allow us to create a new action at the same time that we create the control. Now that we have “Create” button, let’s edit the this control and create a new action. In the “Edit Control” popup, click on “Actions” tab
...
After completing the required fields, clicks on “Submit” button, the new action is linked to the “Button” control.
...
How to update Database with an Action?
One of the common scenarios in the interaction between dataset and actions is the one where the database is updated with new input values but it's not reflected on screen at the moment that was triggered. Let’s analyze what we need to check and how the new action is connected to the Dataset.
...
Let’s check the results in the example.
How the Application works after all the definitions?
Now that the page is setup with Dataset, Controls and Actions, we can verify that the interaction is working as expected. Wayfast allow us to make a preview by click on “Preview” button at the top right corner
...
Info |
---|
In case we want to verify that the functionality is working as expected in database, open the SQL Server Manager and check if the table has the new input values inserted through the app. |
Recap
In the first part, we revised the preconditions to create pages with a basic structure (dataset and controls) and then we learnt how to create new actions that can be related to these Controls previously added. In the second part, we verified how the interaction is executed in the application and how this can be edited to adjust the interaction regarding what we display and what we insert in the database.