Creating a User Exit Routine
Online programs run user exits at predefined points in their execution, based upon the existence of a user exit program in the user object directory, with the specified naming convention.
To create a user exit program, you create procedure description and working storage program segments that follow Lawson 4GL syntax. A user exit program has access to all form fields of the base program. Any Lawson 4GL statement or Application Program Interface may be used. The user exit program segments are compiled into a program which runs automatically when the base program is launched. For more detail on creating Lawson 4GL program segments, see Doc for Developers: Application Development Workbench and Doc for Developers: Lawson 4GL Application Program Interfaces.
User exit programs must have the same number of form control sections as the base application program. For example, if the program GL40 has nine form control sections, so must a user exit for GL40. A form control section is named ProgramCode S n -TRANSACTION, where n is the form number. For example, the form control section for the first form of GL40 would be named GL40S1-TRANSACTION.
While a user exit program must follow all Lawson 4GL syntax rules, an entry in Program Definition is not required. When the base program is launched, it automatically checks for the existence of one or more user exits.
To create a user exit routine