Consultor Eletrônico



Kbase 21737: Dynamics: Where and How To Validate When Using SDOs
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/01/2002
SUMMARY:

This Solution describes how to validate using the new procedures that are available in Progress Dynamics.

EXPLANATION:

The ADM2 standard procedures could be used to do validation in Dynamics (see Knowledge Base #21182), however twelve new procedures and buffers were added to validate in Dynamics when using SmartDataObjects (SDOs).

The four validation procedures in the ADM2:

preTransactionValidate,
beginTransactionValidate,
endTransactionValidate and
postTransactionValidate

were expanded to be fired in each of the record events like create, delete and update.

The following is a list of the twelve new validation procedures:

Create event
CreatePreTransValidate
CreateBeginTransValidate
CreateEndTransValidate
CreatePostTransValidate

Write event
WritePreTransValidate
WriteBeginTransValidate
WriteEndTransValidate
WritePostTransValidate

Delete event
DeletePreTransValidate
DeleteBeginTransValidate
DeleteEndTransValidate
DeletePostTransValidate


The four procedures in the ADM2 can be used to validate in Dynamics, however the ADM2 validation procedures and the Dynamics validation procedures cannot be used in combination.

The Dynamics validation procedures are executed according to the record event, therefore is not necessary to check the RowObjUpd temp-table to know what records were changed.

This table shows what set of procedures are executed for each record operation:

Operation Set of validation procedures that will be executed
Add Create, Write
Copy Create, Write
Delete Delete
Update Write

Instead of the RowObjUpd, two new buffers were added to reference the update and old buffer. The update buffer has the name b_<tablename> and the old buffer has the name old_<tablename>. Therefore, if a procedure for the customer table is customized, the update buffer will be b_customer and the old values will be in the old_customer buffer.

The following list shows how the validation procedures are executed and which are in the transaction block scope:

CreatePreTransValidate
WritePreTransValidate
DeletePreTransValidate

DO TRANSACTION ON ERROR UNDO, LEAVE:
CreateBeginTransValidate
WriteBeginTransValidate
DeleteBeginTransValidate
CreateEndTransValidate
WriteEndTransValidate
DeleteEndTransValidate
END.

CreatePostTransValidate
WritePostTransValidate
DeletePostTransValidate