Progress Appbuilder Demos not Working

Posted by Admin on 05-Sep-2009 21:22

I'm trying to learn ADM2 and am following the Field-Level and Record-Level validation procedures in the OpenEdge Development: ADM and SmartObjects manual (pages 7-15 to 7-18) and neither work.  I'm just running a local database (no server).  The first procedure validates the Sports2000 Qty field in Orderline ('QtyValidate') and nothing happens when I change the field to 0:

DEFINE INPUT PARAMETER valqty AS CHARACTER NO-UNDO.
IF INTEGER(valqty) = 0 THEN RETURN
"Order Line quantity must be greater than zero".
END PROCEDURE.

It doesn't appear that the program looks at this code (I put a message statement in it which didn't display).  Any ideas why it wouldn't run the procedure?

Also, the following Record-Level procedure (RowObjectValidate) won't run:


If rowobject.credit-limit <= 0 THEN RETURN
"Credit limit must be greater than zero".
END PROCEDURE.

I get an "Unknown table name: rowobject" message.

Are there other settings needed to make this work?

TIA

Paul

All Replies

Posted by Admin on 05-Sep-2009 22:24

I haven't used field-level validation so can't respond to that.  Where did you place then procedure RowObjectValidate in the sdo?  The message that you get there seems to indicate that is sdo is not compiled as it doesn't recognise the table rather than it not being available.  Did you create the sdo from the pallet it seems that you may not have be built from the sdo template.

Posted by Admin on 06-Sep-2009 07:40

Did you create those procedures in the SDO (SmartDataObject) and made sure that the "DB Required" flag is not set for the procedures?

Posted by Admin on 06-Sep-2009 13:10

Thanks guys!  By your answers I could tell that I wasn't putting the procedure in the right place.  I clicked on the SDO in the SmartWindow and brought up the Section Editor from there and was putting the procedure in the SmartWindow.  When I  added the procedures to the original SDOs everything worked fine.  Interestingly, it didn't matter whether DB-Required box was checked, but the Handbook says to keep it checked unless you don't have any references to  the database.

Posted by Admin on 06-Sep-2009 13:32

Interestingly, it didn't matter whether DB-Required box was checked, but the Handbook says to keep it checked unless you don't have any references to  the database.

If it's written like that I'd consider that an issue with the documentation. It's not all that simple...

Code (in the SDO) with the "DB Required" flag turned on will not get compiled into the client side proxy. So when you run it from the AppBuilder it will probably not matter, but as soon as you deploy to an AppServer configuration it will matter. So the flag has a big impact on the workflow within the SDO.

The ...Validate procedures are designed to be on the client, so they need to be part of the client side proxy (SDO_cl.w), thus DB required has to be turned off and database access is against the rules

This thread is closed