Finding the right place to customize
To determine where to add code to make your customization, use Code Link or Code File properties or consider these questions.
Direct access with Code Links
The most common places to customize the generated code are accessible from Code
Link properties. Code Link properties provide direct access to
the
POINT
in the appropriate generated file. For example, the Compute
Fields
property on a Form record opens the correct generated
4gl file to the POINT
location logically used for computing
fields.{<POINT Name="fct.recExample_computeFields.user">} {</POINT>}
You will find Code Link properties available on:
Meta-schema - Select the background of the Meta-schema diagram.
- table
Constraints
Key Uniqueness
Key Exists
Select
Insert (before)
Insert (after)
Update
Delete
Delete (Concurrent)
Cascade Delete
Optimistic Locking
Defaults
- column
Constraints (Column)
Form
- Records tab
- ManagedForm - Select the background of the Form Records tab.
Open Window
UI Automaton
Display Mode Events
Input Mode Events
Search Mode Events
Empty Mode Events
Action State
- Record
Select rows
Select row
Computed fields
Insert
Update
Delete
Delete (Concurrent)
Lookups (Descending)
Combobox initializer (Data)
Defaults (Dialog)
DISPLAY attributes
DISPLAY events
INPUT events
CONSTRUCT events
Action state
Field Activation
- Record field
Field Activation
- ManagedForm - Select the background of the Form Records tab.
- Form tab
- Combobox widget
Combobox initializer (Data)
Combobox initializer (UI)
- Combobox widget
Direct access with Code Files
Code Files properties are available for direct access to the appropriate generated code file.
You will find Code Files properties available on:
Meta-schema - Select the background of the Meta-schema diagram.
Data
opens Schema_dbxdata.4glConstraints
opens Schema_dbxconstraints.4gl
UI
opens Form_ui.4glDialogs
opens Form_uidialog.4glDialog Data
opens Form_uidialogdata.4glData
opens Form_uidata.4gl
Manually finding the right location
If a Code Link is not available to help guide you to a location for your custom code, these questions can help you determine where to customize.
- Can the modification be done in a model?
- For example, can you make a change to a property on an entity in the BA diagram to get the desired effect? This is the best first choice because the models drive the code generation. When you rebuild, the generated code reflects your changes. See Modeling the application.
- Can the modification be done in an external resource file?
- For example, you can modify the default Toolbar file that is loaded by the program. Modifying an external resource file does not affect the code generation if you use the default naming convention (dbapp.4tb, for example). When you rebuild, the modified resource file is loaded instead of the default one. See Modify action defaults, Modify styles, Modify the Top Menu, Modify the Toolbar.
- Is the modification database related?
- Look at the functions in the Schema_dbxdata.4gl and Schema_dbxconstraints.4gl files. Look for a
POINT
in the function to place your custom logic. If aPOINT
is not available, modify theBLOCK
of code. See Using POINTs and BLOCKs. - Is the modification for when the program begins or ends?
- Look at the
MAIN
function in the Program.4gl file. Look for aPOINT
in the function to place your custom logic. If aPOINT
is not available, modify theBLOCK
of code. See Using POINTs and BLOCKs. - Is the modification related to the interaction with the user?
- Look at the functions in the Form_ui.4gl, Form_uidialog.4gl, Form_uidialogdata.4gl, and Form_uidata.4gl. Look for a
POINT
in the function to place your custom logic. If aPOINT
is not available, modify theBLOCK
of code. See Using POINTs and BLOCKs. - Is the modification related to reporting?
- Look at the functions in the _report.4gl and
_reportdata.4gl files. Look for a
POINT
in the function to place your custom logic. If aPOINT
is not available, modify theBLOCK
of code. See Using POINTs and BLOCKs. - Is the modification related to web services?
- Look at the functions in the _service.4gl and
_server.4gl, and _uidata.4gl files. Look for a
POINT
in the function to place your custom logic. If aPOINT
is not available, modify theBLOCK
of code. See Using POINTs and BLOCKs. - Is the modification repeating many times?
- Consider modifying the template files. See BAM Template Developer Guide.