What is a Save Action?
The Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
action inserts or updates records in into a selected specified table.
Save actions only save attributes mapped into them. However, if 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 formthe 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 must be attached to a table with a Type of Transactional. Reword? "Save actions will only insert or update records in tables with the Type of Transactional."with a Period of Transactional.
Excerpt |
---|
|
Expand |
---|
title | How to check a table's period |
---|
| The table periods are: Insert excerpt |
---|
| Table |
---|
| Table |
---|
name | Period |
---|
nopanel | true |
---|
|
To check the period of a table: - Find the table in the
Insert excerpt |
---|
| _repository |
---|
| _repository |
---|
nopanel | true |
---|
|
- Right-click it, then choose
- On the table's
Insert excerpt |
---|
| _property_tabs |
---|
| _property_tabs |
---|
nopanel | true |
---|
| , in the Analysis Options section, the Period drop down can be found
Image Added |
|
Creating Save Actions
- Click On an Actionflow, click the
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
icon in the toolbar to display any existing tables in the application- Existing tables can be dragged from the Repository onto the canvas, then choose
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
to create a Save node
- Alternatively, drag the drag the
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
icon from the toolbar onto the canvas - In the Create Save Action window:
- Enter a name
- Choose a Type:
- Auto Insert/Update -: Insert or update records using the following condition:
- If the input data passes in the primary key of an existing record, the save action updates the record in the chosen table
- 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
- Insert -: Always insert a new record into the chosen table
- Update -: Always update a record for the chosen table. For a record to update successfully a primary key must be provided.
- Choose the Table from the drop down where the records will be inserted or updated
- Select Create Action
Excerpt |
---|
|
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 |
---|
Image Added |
Column |
---|
Image Added |
|
|
HTML Comment |
---|
|
Insert excerpt |
---|
| Save Node |
---|
| Save Node |
---|
nopanel | true |
---|
|
|
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, this the data has and screens have already been pre-loaded into the Actionflow Foundation Application. |
Earlier in this course we created two Open Screen Actionflows that open an input form for adding and editing courses to the School Courses grid. In this example we will configure the Save action.
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.
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.
Image Added
Save Action to Add and Edit Data
Create a Save Action to save data to the school courses table.
- On the Course Management screen, press either the Image Removed or Image Removed button to open the Course Form Rightscreen where the Actionflow will be initiated from, Course Form, right-click on the button and choose
Insert excerpt |
---|
| _actionflow_add |
---|
| _actionflow_add |
---|
nopanel | true |
---|
|
- Enter a name for the Actionflow,
- Name:
Save Course
- Select Confirm
- Select Click to Connect under Connections and for the input, choose the Course datasource data source, then select Connect Input
- In the Mappings window that opens, drag the CourseID attribute from the left (Course Form) to into the Drag and Drop area on right (Input Connection Point)
- Select Save
- Click and drag the
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
icon from the toolbar onto the canvas - In the Create Save Action window enter:
- Name:
SaveCourse
- Type: choose Auto Insert/Update
- Table: choose School_Courses
- Select Create Action
- Click and drag the
Insert excerpt |
---|
| _driving_interface_connection_point |
---|
| _driving_interface_connection_point |
---|
name | icon |
---|
nopanel | true |
---|
|
icon onto the Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
action node - Right-click on the in connector and choose Open Mappingsbetween the and
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
action node, and choose Insert excerpt |
---|
| _open_mappings |
---|
| _open_mappings |
---|
nopanel | true |
---|
|
- Drag the CourseID attribute on the left onto the CourseID attribute on the right
- Select Save
- Click on the Save action the
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
action node and in the Insert excerpt |
---|
| _property_settings |
---|
| _property_settings |
---|
nopanel | true |
---|
|
, toggle on Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
Auto Save Attributes Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
the properties tabFinally, in the Settings above the canvas, toggle on
Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
Close screen after action completes Expand |
---|
|
Image Added |
- Close the Actionflow to and return to the Course Management screen
- the screen and press the click Image Modifiedor Image Removed buttonEither enter new course details or edit the existing course details and or Image Added to open the Course Form
- Enter/change the course details, then press to see the Actionflow in action
- 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
Image Modified