Versions Compared

Key

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

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

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

What is a Delete Action?

The 

Insert excerpt
_delete
_delete
nopaneltrue
  action delete records for a selected table. 

Note: Delete actions Delete actions will only insert or update delete records in tables with the Type of Transactional. Correct?

Creating Delete Actions

  1. Click the 
    Insert excerpt
    _delete
    _delete
    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
      _delete
      _delete
      nopaneltrue
      to create a Delete node
  2. Alternatively, drag the 
    Insert excerpt
    _delete
    _delete
    nopaneltrue
     icon from the toolbar onto the canvas
  3. In the Create Delete Action window:
    1. Enter a name
    2. Choose the Table from the drop down where the records will be inserted or updateddeleted
    3. Select Create Action
HTML Comment
hiddentrue

Need to create a page on the Delete node properties.

When creating delete actions it can be useful to set up confirmation messages that allows users to confirm or cancel the deletion. If you are completing the Actionflow course, confirmation messages will be covered in a later chapter. See LINK

Worked Example

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

Tip

If you are completing this chapter as part of the Actionflow course and using a training instance, this data has already been pre-loaded into the Actionflow Application.

Earlier in In this course we created two Open Screen Actionflows that open an input form for adding and editing courses to example, we want to be able to delete courses in the School Courses grid . In this example we will configure the Save action.on the Course Management screen. We will also configure the Delete Actions on the input form

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

Save

Delete Action to

Add and Edit

Delete Grid Data

  1. On the Course Management screen, press either the Image Removed or Image Removed button to open the Course Form Rightright-click on theImage Removedthe Image Added button and choose 
    Insert excerpt
    _actionflow_add
    _actionflow_add
    nopaneltrue
  2. Enter a name for the Actionflow,
    1. Name: Save Delete Course Grid
    2. Select Confirm
  3. Select Click to Connect and for the input, choose the Course  School Courses 
    Insert excerpt
    _formgrid
    _formgrid
    nopaneltrue
     datasource, then select Connect Input
  4. In the Mappings window that opens, drag the CourseID attribute from the left (Course FormSchool Courses Grid) to the right (Input Connection Point)
    1. Select Save
  5. Click and drag the 
    Insert excerpt
    _action_savedelete
    _action_savedelete
    nopaneltrue
     icon from the toolbar onto the canvas
  6. In the Create Save Delete Action window enter:
    1. Name: SaveCourse
    2. Type: choose Auto Insert/Update
    3. DeleteCourse
    4. Table: choose School_Courses
    5. 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_savedelete
    _action_savedelete
    nopaneltrue
     action node
  8. Right-click on the in connector and choose Open Mappings
    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
    Click on the Save action node and in the 
  9. Close the Actionflow to return to the Course Management screen
  10. Insert excerpt
    _lock
    _lock
    nopaneltrue
     the screen and select a record in the grid, then press the Image Added button

Delete Action to Delete Form Data

  1. On the Course Management screen, select the Image Added or Image Added button to open the Course Form
  2. Right-click on the Image Added button on the Course Form and choose 
    Insert excerpt
    _propertyactionflow_settingsadd
    _propertyactionflow_settingsadd
    nopaneltrue
    , toggle on 
  3. Enter a name for the Actionflow,
    1. Name: Delete Course Form
  4. Repeat the above steps to configure the Actionflow but make the following changes:
    1. the input is the Course 
      Insert excerpt
      _
    toggle_on
    1. form
      _
    toggle_on
    1. form
      nopaneltrue
     Auto Save Attributes
    Finally,
    1. in the Settings
    above the canvas
    1. , toggle on 
      Insert excerpt
      _toggle_on
      _toggle_on
      nopaneltrue
       Close screen after action completes
    Close
    1. - this will close the Course Form when Image Added is pressed
  5. Once you have configured the Actionflow to , return to the Course Management screen
  6. Insert excerpt
    _lock
    _lock
    nopaneltrue
     the screen, select a record in the grid and press the  Image Added button
  7. On the Course Form, press the Image Removedor Image Removed button
  8. Either enter new course details or edit the existing course details and press Image Removed to see the Actionflow in action
    1. We can see that the Actionflow is working because the grid is updated with the data we have just created/edited 

--

Link to confirmation help page here.
  1. Image Added button
    1. If the Actionflow has been set up correctly, the Course Form will close and the selected record will be deleted from the School Courses Grid
Tip
titleWhy do we not reuse the Delete Course Actionflow?

An Actionflow can be reused where the same Actionflow setup is required but with a different input. The Actionflow setup for Delete Course and Delete Form are nearly identical except for one key difference - the Delete Form Actionflow has Close screen after action completes enabled. If we were to reuse this Actionflow with two different inputs (grid and form), the Close screen after action completes option would need to be consistent across both instances of the Actionflow.