AVANT_OUVRE

Description

This action is the first one to be called when entering the OBJect management; it is called only once. The main table declared in OBJect management is open but the secondary tables are not.

OBJect type

Simple, Grid, Combined

Transaction

No

Use

This action is very rarely used.
This action provides the ability to stop the process by setting the OK variable to 0 and also to display a message in GMESSAGE.

For instance: in the OBJect of the sales invoices (SUBSIHA)

In the AVANT_OUVRE action, the locality level of the open secondary tables is retrieved. This is a necessary step in case of picking in the same table in the calling OBJect and the current OBJect. The, the OBJect opens the secondary tables. Finally, in the OUVRE action, the opening of the table used in the picking is forced, if said table has not been opened by the OBJect.

$AVANT_OUVRE
Global Integer GFILELEVSOP
Raz GFILELEVSOP
If clalev([F:SOP])<>0 GFILELEVSOP=filelev([F:SOP]) Endif
Return

$OUVRE
# The SOP table has been opened in another sub-prog (different level)
# It needs to be reopenend for a new 'Link' to be performed
If filelev([F:SOP]) = GFILELEVSOP
   Local File SORDERP [SOP]
Endif
Return