Wrapper for QAD Sales Order Maintenance

Doug_b

New Member
I'm a novice Progress user (but I know .NET, COBOL, etc).

I've been looking at some source code (legacy) and I've gleaned some knowledge.

What I want to do is when a new record is inserted is initialize some fields. What is the syntax of the trigger?

I guessed "ON insert so_mstr DO:" but that's no right.

Is there any Progress/Open Edge doc's that give examples / explanations?

Thanks.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
You didn't mention your version, but as you said "OpenEdge" I'll assume it's at least 10.0A.

Have you looked at the ABL Triggers and Indexes manual in the documentation set? It is in the ABL section.

Before you dive into implementing this, you may want to ask yourself (and/or someone who is more familiar with the application) whether trigger code is the appropriate way to implement your desired functionality.

Could you instead insert the desired code in the application business logic that creates so_mstr records? Or even change the initial value defined for these fields in the schema (assuming these are not calculated values)?
 

Doug_b

New Member
I don't have the QAD source code. I'm looking at some legacy code where they have code like this:


if focus:frame-name = "c" and focus:name = "line" then do:
assign
sodline = int(focus:screen-value)
check-mgn = yes
no-error.
end.

I have several items that I need to check on data entry screens. What I'm looking for are some real world examples.
 

SergioC

Member
Hi, may be this will serve, connect to sports2000 db:

Code:
ON CREATE OF Customer DO:


   /* Not apply - apply initial values defined in the schema */
   IF Customer.Terms = '' THEN
   ASSIGN Customer.Terms = 'NUEVOS TERMINOS'.


   /* apply */
   IF Customer.Address = '' THEN
   ASSIGN Customer.address = 'NUEVA DIRECCION'.


END.


REPEAT:
   CREATE customer.
   UPDATE customer WITH 1 COL SCROLLABLE.
END.

Regards.
 
Top