This Knowledge Base article describes how to roll back to a previous version of a View or a Form.
Views or Forms can be rolled back to a previous version or deleted version of the View or Form.
The ID and Name of a View can be found in the Form.View table (if the View is checked in);
and in the Form.View_Design table (if the View is checked out).
Similarly, the ID and Name of a Form can be found in the Form.Form table (if the Form is checked in) and in the Form.Form_Design table (if the Form is checked out).
When a View or Form is successfully deployed (when it is Saved or the wizard is Finished) an entry is made in the Form.AuditLog table of the K2HostServer SQL database as shown below.
Filter out the information and get the versions that relate to ONLY what you need in the Audit log table by using the following SQL query:
The specific View or Form can be identified by using the record ID and XML fields. The XML field contains the matching IDs (represented as a GUID) of the Form indicated in orange and the View indicated in Green above. For example record ID field value = 54 in the image above and related ID (represented as a GUID) in the XML field. Open the XML to see the View or Form ID and Name as shown below.
Execute the following statement on the Form.AuditLog table of the K2HostServer SQL database:
Let’s say that the version of the Form deployed in record ID=55 above broke the designer or runtime to a point where it is not recoverable and has to be recreated. To roll back to the previous version of that Form (ID=54), the statement would be:
Example of Stored Procedure