3.01 Bulk Delete Action Configuration
What is a Bulk Delete Action?
The
Note: Bulk Delete actions will only delete records in tables with the Period of Transactional.
vs
The key difference between
To delete records and persist the audit history of the record, see Delete Node.
Creating Bulk Delete Actions
Click the
icon in the Actionflow toolbar to display any existing tables in the applicationExisting tables can be dragged from the Repository onto the canvas, then choose
to create a Bulk Delete node
Alternatively, drag the
icon from the toolbar onto the canvasIn the Create Bulk Delete Action window:
Enter a Name
Choose a Type from:
Delete: allows only records satisfying the specified filter criteria to be deleted
Set the filter criteria in the Bulk Delete Action
under Data Retrieval Options - see section below
Delete All: deletes all data from the selected table
Choose to Allow Audited Table to display tables with Audit Manual Changes enabled in the Table drop down
By default, tables with Audit Manual Changes enabled are not shown in the Table drop down list
Choose the Table from the drop down where the records will be deleted
Or click the table icon to display tables in the Repository
Select Create Action
When creating delete actions it can be useful to set up confirmation messages that allow users to confirm or cancel the deletion. See 1.13 Confirmation Message Configuration.
Setting Delete Action Filter Criteria
Where the Type is set to Delete on the
Choose a Data Range from:
Latest: selects data from the latest recordsets
All: selects data from all recordsets (default)
Set the Filter Criteria to specify which records will be selected for deletion. See Filter → Filter Details
Incoming attributes mapped to the Bulk Delete node can be referenced in the Data Retrieval Options using the syntax, ConnectorName.AttributeName, e.g. in.MyAttribute
Specify Delete Batch Size
Where the Type is set to Delete on the
Bulk Delete Output Attribute (modifiedRows)
The output attribute, modifiedRows, automatically shows when mapping from a Bulk Delete action. This attribute is a count of the rows that are updated by the action, but if the Type (see above) is set to Delete All then the value is unavailable.
Worked Example
Here's a worked example using the Company Data (available from the Learning Centre).
In this example, we are using:
A Company Rejected Companies screen containing three grids of the Companies, Orders and OrderLines data - this screen was created using the Multi-Tile template
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 Advanced Application. For this example, we'll be working on the Company Rejected Companies screen.
Bulk Delete Rejected Companies
In this example, we'll set up an Actionflow to delete all companies with a Status of Rejected, along with any associated Orders and Order Lines.
View Setup
Open the Company Rejected Companies screen
Create an Actionflow on the Delete All button
Name:
BulkDeleteRejectedCompanies
Configure the input connection point to
Create a
to the Companies data to output the CompanyID of rejected companies onlyConnect the input to the View
Lookup Setup
Create a lookup to the Orders data to retrieve the orderIDs as an array. The orderID can then be used to bulk delete the orders and orderLines. A lookup is used to pass a large block of data (an array) rather than one record at a time.
Bulk Delete Action Setup
Create three
actions for deleting from the three tables: Companies, Orders and OrderLinesMap the associated ID attribute into the relevant Bulk Delete node
Set up filters on each node in the Data Retrieval Options section to ensure only records associated with a rejected company are deleted
Testing
Return to the Company Rejected Companies screen and lock the screen
Press the Bulk Delete button
Refresh the data in each grid to see the results
Review the Orders and Order Lines data to check there are no orders or order lines with a blank company