Consultor Eletrônico



Kbase 18748: Code Sample using the TransactionValidate Procedure with SmartDataObjects
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/03/2005
Status: Unverified

GOAL:

Code Sample using the TransactionValidate Procedure with SmartDataObjects

FACT(s) (Environment):

Example of use of TransactionValidate
Progress 9.x
OpenEdge 10.x

CAUSE:

TransactionValidate procedures are run just before the update transaction on the server. The procedure has access to the RowObjUpd table and also should return a message on error.

FIX:

Follow these steps to implement the Transaction Validate Procedure in the Sports database:

1) Create a SmartWindow.

2) Create a SmartDataObject off of the customer's table including the name and credit-limit fields.

3) Create a SmartDataViewer off of the above SDO with it's fields.

4) Drop the SDO onto the SmartWindow and link it to the above viewer with data and update links.

5) Drop a commit SmartPanel on the SmartWindow and link it to the SDO with a commit link.

6) Drop a Save SmartPanel onto the SmartWindow with a TableIO link to the SmartDataViewer.

7) Create a new procedure in the SDO called TransactionValidate with the following code:

IF RowObjUpd.Credit-Limit <= 0 THEN
RETURN "Credit limit must be greater than zero".
8) If the credit-limit is less than or equal to the value 0, you receive the above returned message when you hit the commit button from the commit SmartPanel.


FIX:

References to Written Documentation:

Progress AppBuilder Developer's Guide, Chapter 15