Consultor Eletrônico



Kbase 18746: Code Demonstrating the Use of ADM2 RowObjectValidate Procedure
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   20/10/2008
Status: Verified

GOAL:

Example of how you can implement the use of the ADM2 rowobjectvalidate procedure in a SmartDataObject (SDO) for row validation.

GOAL:

Code Demonstrating the Use of ADM2 RowObjectValidate Procedure

FACT(s) (Environment):

Progress 9.x

FIX:

You might want to validate at the row level of an SDO by creating a RowObjectValidate procedure. You can accomplish this by referring to the rowobject buffer. This procedure runs each time an update occurs to a new or existing row in the SDO. The procedure should return a message on error.
Follow these steps to implement the rowobjectvalidate procedure using Sports database as an example:

1) Create a SmartWindow.

2) Create an SDO from the customer table, including the name and credit-limit fields.

3) Create a SmartDataViewer from the SDO with the fields in it.

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 rowobjectvalidate with the following code:

IF RowObject.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.


FIX:

References to Written Documentation:

Progress AppBuilder Developer's Guide, Chapter 15