Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

By the end of this chapter you will understand what a Save action is and how to use them, and you will have created a Save Actionflow in your application.

What is a Save Action?

The  Save action inserts or updates records in a selected table. 

If the Save action has Auto Save Attributes enabled, this saves unmapped attributes from the input form or view, matched by identifier. This finds the attribute associated with a field that was created by dropping the attribute onto a form.

Note: Save actions will only insert or update records in tables with Type of Transactional

Creating Save Actions

  1. Click the  Save icon in the toolbar to display any existing tables in the application
    1. Existing tables can be dragged from the Repository onto the canvas, then choose  Save to create a Save node
  2. Alternatively, drag the  Save icon from the toolbar onto the canvas
  3. In the Create Save Action window:
    1. Enter a name
    2. Choose a Type:
      1. Auto Insert/Update - Insert or update records using the following condition:
        1. If the input data passes in the primary key of an existing record, the save action updates the record in the chosen table
        2. If the input data does not pass in the primary key of an existing record, the save action inserts a new record in the chosen table
      2. Insert - Always insert a new record into the chosen table
      3. Update - Always update a record for the chosen table. For a record to update successfully a primary key must be provided.
    3. Choose the Table from the drop down where the records will be inserted or updated
    4. Select Create Action

Worked Example

Here's a worked example using the School Data (available from the Learning Centre). WHAT DOES IT SHOW?

We want to be able to save new and edited courses. To do this, we will configure a Save Action on an input form that saves the data from the input form to the school courses grid.

If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Application. For this example, we'll be working on the Course Management screen and opening the Course Form screen.

In this example, we are using:

  • a Course Management screen containing a grid of the School Courses data - the screen was created using the Tile with Buttons template
  • a Course Form screen containing form fields, associated with School Courses data by a background filter - the screen was created using the Edit Form template

Note: When creating a new input form in PhixFlow, a Form Actions wizard can configure the Save Record and Delete Record actions for you. For the purposes of understanding the mechanics of Actionflows, we will create these manually.

Save Action to Add and Edit Data

Create a Save Action to save data to the school courses table.

  1. On the Course Form screen, right-click on the button and choose  Add Actionflow
  2. Enter a name for the Actionflow,
    1. Name: Save Course
    2. Select Confirm
  3. Select Click to Connect and for the input, choose the Course  Form datasource, then select Connect Input
  4. In the Mappings window that opens, drag the CourseID attribute from the left (Course Form) to the right (Input Connection Point)
    1. Select Save
  5. Click and drag the  Save icon from the toolbar onto the canvas
  6. In the Create Save Action window enter:
    1. Name: SaveCourse
    2. Type: choose Auto Insert/Update
    3. Table: choose School_Courses
    4. Select Create Action
  7. Click and drag the  icon onto the  Save action node
  8. Right-click on the in connector and choose Open Mappings
    1. Drag the CourseID attribute on the left onto the CourseID attribute on the right
    2. Select Save
  9. Click on the Save action node and in the  Properties, toggle on  Auto Save Attributes
  10. Finally, in the Settings above the canvas, toggle on  Close screen after action completes
  11. Close the Actionflow to return to the screen
  12. Either enter new course details or edit the existing course details and press  to see the Actionflow in action
    1. We can see that the Actionflow is working because the School Courses grid on the Course Management screen is updated with the data we have just created/edited 

SCREEN SHOT OF WHAT WAS CREATED?

  • No labels