Deleting Records
The functionality to delete records is available in the 4.0.11 codebase.
A record, is just one instance of a form, for example a specific person form, person|1234.
Enabling the Delete Record Module
In order to delete records, you will need to enable the deleteRecords module. To do so go to:
- Configure System
- Configure Modules
- Click the "Sub-Modules" link to the right of the "Pages" module
- Click the "Sub-Modules" link to the right of the "Admin" module
- Select the "Delete
Deleting Records
Before you begin, Back up your database!! As this feature has not been extensively tested and there are no "safe guards" you will want to back up the database so you can recover from any mistakes.
The delete records is only a "command line" only feature. It is not available to the web-interface. To use it, you should open up a terminal to get to the command line. Now change to the directory of your site that contains the index.php file. For example: <source lang='bash'> cd /var/www/iHRIS/manage </source> or <source lang='bash'> cd /var/lib/iHRIS/sites/4.0/manage/pages </source>
The deleteRecord has been registered as a sub-page of the admin module. So, once you are in the same directory as index.php, you can use the delete record feature by: <source> php index.php --page=/admin/deleteRecord </source>
Rules for Operation
- Whenever deleting a form instance (or record) you are forced to also delete any child forms of that record
- For example, when deleting a person form, there may be one or more child forms person_position that will be need to be deleted.
- Whenever deleting a record, it will show you and all the forms that the form link to
- For example a person_position form links to a position form. If that position form was created just for that person, you may want to delete that position
- Whenever deleting a record, it will show you all the forms that link to that form
- For example, if you are deleting a position form, there may be one or more person_position forms that link to that position. Once you have deleted a position, than you 'must delete these person_position forms.
Example Output
Here is an example of deleting a person from the iHRIS Manage Demonstration site.
Preserving Deletions
All records that are deleted are automatically stored in the database in the form_history table with the deletion time and all the data stored as a json encoded string.