Below mentioned tables will be required while the update
Table Name | |
---|---|
dyextn_containers | Table where the custom forms are stored |
catissue_form_context | Contains form attachment levels |
catissue_form_record_entry | Contains the actual records entered in the form |
The steps mentioned below will help the user to recover the data for the form deleted or detached from the level
When form is deleted
For example: The user has accidentally deleted the Chemotherapy form. Run the below SQLs:
select xml from dyextn_containers where caption = 'Chemotherapy form';
The output would be the form xml file along with the form ID and database table name in which the form records are stored. Eg: Form ID is 86 and db table name is 'DE_E_11006'
<container id="1"> <id>86</id> <name>chemotherapyForm</name> <caption>Chemotherapy form</caption> <dbTableName>DE_E_11006</dbTableName>.......
To restore the form,
SQL> select IDENTIFIER, NAME, DELETED_ON from dyextn_containers where caption = 'Chemotherapy form';
IDENTIFIER | NAME | DELETED_ON |
---|---|---|
86 | chemotherapyForm | 2018-05-24 15:05:04 |
To reactivate the form, the deleted_on date needs to be blanked out. Run the below SQL to do so:
SQL> update dyextn_containers set deleted_on = null where identifier = 86;
After this the form will reappear in the form list. Follow the steps in the section below to retrieve the data for the records.
When form is detached
Check the identifier (attachment ID) of the form in the form context table.
SQL> select * from catissue_form_context where container_id=86;
IDENTIFIER | CONTAINER_ID | ENTITY_TYPE | CP_ID | SORT_ORDER | IS_MULTIRECORD | IS_SYS_FORM | deleted_on |
---|---|---|---|---|---|---|---|
29 | 86 | Participant | 5 | NULL | 17/05/18 11:08 |
There is a deleted_on date added, which needs to be blanked out
SQL> update catissue_form_context set deleted_on = null where identifier = 29;
This will restore the form attachment level and the records as well.