Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

What is a Save Action?

The 

Insert excerpt
_action_save
_action_save
nopaneltrue
 action inserts or updates records into a specified table. 

If the Save action has Auto Save Attributes enabled, this saves unmapped attributes from the input form or view, matched by the primary key. The primary key must be mapped. Where it is empty, a new record is inserted but if it is populated, the existing record is updated.

Note: Save actions will only insert or update records in tables with a Period of Transactional. 

Excerpt
nameTablePeriod


Expand
titleHow to check a table's period

The table periods are:

Insert excerpt
Table
Table
namePeriod
nopaneltrue

To check the period of a table:

  1. Find the table in the
    Insert excerpt
    _repository
    _repository
    nopaneltrue
  2. Right-click it, then choose
    Insert excerpt
    _edit
    _edit
    nopaneltrue
  3. On the table's 
    Insert excerpt
    _property_tabs
    _property_tabs
    nopaneltrue
    , in the Analysis Options section, the Period drop down can be found

Image Modified


Creating Save Actions

  1. On an Actionflow, click the 
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     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 
      Insert excerpt
      _action_save
      _action_save
      nopaneltrue
      to create a Save node
  2. Alternatively, drag the 
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     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


Excerpt
nameFormActions

Create Actionflow using Form Actions Wizard

After displaying attributes as fields on a screen, a Form Actions wizard is available to automatically create the Save and Delete Actionflows.

Drag and drop Save Record onto a Save button and Delete Record  onto a Delete button, or drag anywhere on the screen to create the button(s) automatically.


Section


Column


Column




HTML Comment
hiddentrue

Insert excerpt
Save Node
Save Node
nopaneltrue

Worked Example

Here's a worked example using the School Data (available from the Learning Centre). 

In this example, we are using:

  • A Course Form screen containing form fields and associated with School Courses data by a background filter - the screen was created using the Edit Form template
Tip

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 Foundation Application. For this example, we'll be configuring a button on the Course Form screen.

We want to be able to save new courses and edit existing ones on a Course Management screen. To do this, we will configure a Save Action on an input form, Course Form screen, that saves the data to the School Courses table. 

Save Action to Add and Edit Data

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

  1. On the screen where the Actionflow will be initiated from, Course Form, right-click on the button and choose 
    Insert excerpt
    _actionflow_add
    _actionflow_add
    nopaneltrue
  2. Enter a name for the Actionflow,
    1. Name: Save Course
    2. Select Confirm
  3. Select Click to Connect under Connections and for the input, choose the Course 
    Insert excerpt
    _form
    _form
    nopaneltrue
     data source, then select Connect Input
  4. In the Mappings window that opens, drag the CourseID attribute from the left (Course Form) into the Drag and Drop area on right (Input Connection Point)
    1. Select Save
  5. Click and drag the 
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     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 
    Insert excerpt
    _driving_interface_connection_point
    _driving_interface_connection_point
    nameicon
    nopaneltrue
     icon onto the 
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     action node
  8. Right-click on the in connector between the
    Insert excerpt
    _input
    _input
    nopaneltrue
     and
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     action node, and choose
    Insert excerpt
    _open_mappings
    _open_mappings
    nopaneltrue
    1. Drag the CourseID attribute on the left onto the CourseID attribute on the right
    2. Select Save
  9. Click on the 
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     action node and in the 
    Insert excerpt
    _property_settings
    _property_settings
    nopaneltrue
    , toggle on 
    Insert excerpt
    _toggle_on
    _toggle_on
    nopaneltrue
     Auto Save Attributes
  10. Insert excerpt
    _finish
    _finish
    nopaneltrue
     
    the properties tab
  11. Finally, in the Settings above the canvas, toggle on 

    Insert excerpt
    _toggle_on
    _toggle_on
    nopaneltrue
     Close screen after action completes

    Expand
    titleCheckpoint


  12. Close the Actionflow and return to the Course Management screen
  13. Insert excerpt
    _lock
    _lock
    nopaneltrue
     the screen and click  or  to open the Course Form
  14. Enter/change the course details, then 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 

1.10 ValidationImage Added