Coded data rules
Coded data rules are written in table and field triggers. They are used to enforce data integrity when it cannot be obtained with simple mechanisms, such as field types or table relations.
One of these data rules that you can see all over the application can be found in the OnDelete()
trigger of most tables. In this trigger, conditions are usually checked to prevent the user from deleting certain information.
In the OnDelete()
trigger of the Location table, some conditions are checked using the WMSCheckWarehouse function. If some conditions make it impossible to delete the location, an error message will be shown and the action will not be taken.
In the OnDelete()
trigger of tables, code also exists to ensure that related information is deleted as well. In the example, transfer routes for the location that is being deleted are deleted as well. The WMSCheckWarehouse function has also deleted the zones, bins, and bin contents of the location that was deleted.
If you...