DeleteCritiqueByCritiqueNo Method

The DeleteCritiqueByCritiqueNo method is a public subroutine that accepts two parameters (CritiqueNo and ConnectionString) and calls the private DeleteRecord method, which deletes the critique record. The CritiqueNo (the critique# of a record in the Critique table of the FmLib database) parameter is concatenated with a string that contains the field name and is passed to the DeleteRecord method as the filter for the delete operation. The second parameter passed to the DeleteRecord method, True, indicates that this delete is the result of the approver rejecting the critique.

DeleteRecord "Critique#=" & CritiqueNo, True

The Critique component is instantiated in the server-side script that runs when the Folder_OnMessageCreated event fires on the public folder in which the critiques are posted; the DeleteCritiqueByCritiqueNo method in the Critique component is then called. This is not a new critique to the CML/LitCrit application but it is a new critique to the LitCrit public folder. When the critique was sent to the approver the item was deleted from the public folder and now the approver's response has reposted the critique to the public folder, which is why theFolder_OnMessageCreated event fires. The DeleteCritiqueByCritiqueNo method is called because the critique was rejected and the previously created critique record in the FmLib database is no longer needed.

The complete code for the DeleteCritiqueByCritiqueNo method is available in Critique.cls Server-Side COM Component in the code section.