Event Driven Action Management

Action Management is now handled using events. Preactions are created by subscription events that utilize Database Table Trigger events published by the “Application Management” codeunit.

Part of this functionality has already been in the LS Central system as an option since version 8, see the Retail Setup page, the Preaction Creation by field. If this field had the value Database Triggers, it worked more or less as it does now. This functionality has now been enhanced to be the only way to create Preactions.

This field, Preaction Creation by, has been changed, so it now has two options as before but the first option, Table Trigger, has been removed and given a new meaning, so the first option is now blank (“ “), meaning that action management is not active and no Preactions are created.
This way of disabling action management could be utilized in a totally online environment, where there is no need to create Preactions.

The second option, Database Triggers, on the other hand, will create Preactions for all tables defined by the Preaction Creation setup table, see more details below. The default value for the Preaction Creation by field should be the second option, Database Triggers.

The Preaction Creation setup table does not have any GUI and is not present in any menu. To initialize it, follow these instructions: 

  1. In the Retail Setup page, click the Insert Default Data action.
  2. On the Insert Default Data page, select the Preaction Creation Setup check box.
  3. Run action Insert, and the system inserts LS Retail predefined tables into the Preaction Creation setup table.

The action can be run by itself or as part of inserting any range of default data. There is a way to affect how this process selects its tables without changing the code: 

The code has two published events, OnAfterCreateValidTableNoBuffer and OnAfterCreateInValidTableNoBuffer. By subscribing to those events, you can add or even delete tables from the standard pool of tables, before the Preaction Creation setup table is created based on the buffer.

So whenever you need to change the Preaction Creation setup table, add or change the subscription event and click the Insert Default Data action.

Note: Every time this setup is changed, all clients must be restarted for this setup to become active.