Tracking Record Revisions
Corteza provides a record revision feature which allows you to configure modules to track changes on records by introducing a new revision counter and providing a history of changes. Corteza keeps a revision counter for each record (starting from 1) that increments every time the record is updated, and only changes in record values are stored for each revision.
Revisions must be enabled for a specific module and can be viewed inside a record revision page block. When enabled, all record changes are stored in the database with the author and the timestamp.
A revision is only added when a record is updated, so newly created records don’t have revisions, which reduces the number of stored revisions.
To enable revision tracking for specific records, we need to enable the option on the Low Code module. In addition to module configuration, you’ll need to configure the record page to display the revision history.
Record revisions are stored in the same connection as the module itself.
Firstly, navigate to your Low Code namespace and enter the admin area (you can also enable record revision for brand new modules).
In the list of modules, click on the one you wish to enable record revisions for.
Click on the record revisions tab and check the enable record revisions checkbox. Optionally input the identifier option.
The identifier option allows you to specify the database table or collection which Corteza should use to log the revisions. A system-defined location is used that should satisfy most use cases.
Once finished, click the save button to save the changes and enable record revision tracking.
To display the revision history, we need to add a record revision page block to the record page. You can skip this step if you only want to track the revision history and not display it.
Since they are tightly correlated, the record revision page block can only appear on the record page.
Navigate to the record page directly from the module itself or from the list of pages (the screenshot below shows how to access the record page from the module edit screen).
Next, click on the + add block button in the toolbar to open up the page block selection modal window.
Find and click on the record revisions page block in the page selection modal.
In the page block configuration modal window, click on the record revisions tab and make sure the configuration matches your needs. The configuration allows you to select a subset of module fields to show on the record revisions page block.
Once satisfied, click on the save button to configure the page block and add it to the record page.
Place the newly added record revisions page block to fit your page.
When the revision tracking is enabled, Corteza also provides a new record revision module field, which indicates the revision number. You can add the module field on both the record and record list page blocks.
Once satisfied with your changes, click on the save button to save your changes.
To view record revisions, click on the record you wish to see the revision history for.
You can view the entire revision history in the record revisions page block. Each revision entry logs the timestamp, the performed operation, and the user that performed the operation.
To view the revision details, click on the change(s) button at the far right of the revision you wish to inspect.
The detailed view will list the logged value changes for that revision.