Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table Name
dyextn_containers
Table A table where the custom forms are stored
catissue_form_contextContains form attachment levels
catissue_form_record_entryContains 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:

...

The output of this command would be:

IDENTIFIER

NAMEDELETED_ON
86chemotherapyFormchemotherapy for

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:

Code Block
languagesql
titleremove_deleted_on_date
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.

...

There is a deleted_on date added, which needs to be blanked out.

Code Block
languagesql
titleremove_deleted_on_date
update catissue_form_context set deleted_on = null where identifier = 29;

...

CASE 2: The form was detached and reattached again, the user performed data entry after reattaching the form. There will some records pointing to the older ID and some to the new ID. We need to update the older records to point to the new form of attachment.

To find the database table name in which the records of the form are saved, run the below SQL:

...

The output would be the form xml 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 DB table name is 'DE_E_11006'

...

Check the total number of records present in the DE_E_11006 table.

Code Block
languagesql
titlecheck_DE_count
SELECT count(*) from DE_E_11006;

The number or of records is 

count(*)
25

Check the latest form from the context identifier of the form.

...

The output of the command would be like below: The older form ID was 29 and the new one (when the form was reattached) is 30.

...

There are 10 records from the older entry

count(*)
10

For ID 30,

Code Block
languagesql
titleget_record_count
select * from catissue_form_record_entry where form_ctxt_id = 30;

There are 15 records from the new entry

count(*)
15

After moving the records from old to the new ID, the sum should be the same as that in the database DE table.

...

The output of the above command.

IDENTIFIERFORM_CTXT_IDOBJECT_IDRECORD_IDUPDATED_BYUPDATE_TIMEACTIVITY_STATUS
14338129115142552423/05/18 14:35ACTIVE
14340429413142575423/05/18 16:31ACTIVE
143358291506142529423/05/18 14:09ACTIVE
143363291507142534423/05/18 14:22ACTIVE
143379291513142550423/05/18 14:31ACTIVE

Need to move all the records 

...