How-to Resources 

Deleting Records - best practice 

There are many scenarios where you need to allow a user to delete a record, where:

If there are no dependencies, the record should truly be deleted, but

If there are dependencies, or related records that rely on it being retained for audit purposes, the record should appear to be deleted, but in fact it is only 'soft deleted' with a checkbox flag set to hide it.

To do this:

Add fields to the Table

  • IsActive - type Checkbox, default value Enabled
  • _Action - type Text, default blank

Now create a Data Entry Form, based on this Table

in this:

  • Show the user a prompt to ask them to confirm if they want to delete the record.

     
  • Add a Submit button, that sets the _Action field to "Remove" - which we pick up on later.

     
  • Add another Submit button, that sets the _Action field to "Keep", to give the user an alternative to click if they decide at this point to retain the record.

     

In the Events tree for the Table:

Under the Record Change event:

  • Add a Record Criteria condition that checks for the _Action field being set to Remove

Under this:

  • Add an Update Field action to uncheck the IsActive checkbox field
  • Add a Delete Record action

Note: The Delete Record action will only succeed in deleting the record if the Referential Integrity rules are satisfied - ie there are no related records that prevent it being deleted. If they do prevent it being deleted, then the IsActive field, set to false, can be used to hide the record from the user (using record criteria in query embeds etc)

Finally (assuming the record hasn't been Deleted), the Update Field action "Reset _Action" clears the value from _Action, to avoid confusion in any subsequent user interactions.

Techniques & KB Articles 

In this section

Techniques & KB Articles 

In this section:

Copyright © 2026 Enstar Systems Inc.    All rights reserved