Skip to main content

Soft delete

Instead of deleting an instance of a data elementData Element (DataElement). A fundamental data concept or entity within an application's domain, acting as an anthropomorphic translation of a real-life object or concept., the deleted instance can be flagged with disabled. This will hide the instance from the user interface and find results, but still allows you to implement custom logic that might use these deleted instances.

This functionality can be enabled by creating a fieldFieldA property of a DataElement expanded to a database column and user interface input element. with name disabled; it should be a String. The fieldFieldA property of a DataElement expanded to a database column and user interface input element. will be used to mark 'soft delete' instances, meaning that instances will have disabled set to yes when deleted, rather than be deleted from the table.

It is also possible to use another fieldFieldA property of a DataElement expanded to a database column and user interface input element. for this functionality by adding the cruds.softDelete option.

Option
cruds.softDelete Field

Overrides the default delete functionality to instead use this fieldFieldA property of a DataElement expanded to a database column and user interface input element. as a fieldFieldA property of a DataElement expanded to a database column and user interface input element. to filter out deleted instances. The deleted instances will still be present in the database, but not visible.

<options>
<cruds.softDelete/>
</options>
Option
cruds.softDeleteOnModify Application

Delete instances on modify if a disabled fieldFieldA property of a DataElement expanded to a database column and user interface input element. is set to false.

<options>
<cruds.softDeleteOnModify/>
</options>