|
The sc_apl_conf() macro allows one application to dynamically modify execution properties of another application. For example, it can force a Form to start in insert mode, make a Grid start with the Search screen, define the number of rows or columns, or enable/disable toolbar buttons.
Note: This macro must be used from one application to modify the behavior of another.
Form Application Properties
| Property |
Value |
Description |
| start |
new |
Starts the Form in insert mode. |
| insert |
on/off |
Enables or disables the "Add New" button. |
| update |
on/off |
Enables or disables the "Save" button. |
| delete |
on/off |
Enables or disables the "Delete" button. |
| field_display_off |
field |
Hides a specific field dynamically. |
| field_display_on |
field |
Shows a specific field dynamically. |
| field_readonly |
field |
Sets a field to read-only dynamically. |
| rows |
number |
Defines the number of rows per page (for multiple records Form). |
| rows_ins |
number |
Defines the number of insert rows (for multiple records Form). |
Grid Application Properties
| Property |
Value |
Description |
| start |
filter |
Starts the Grid using the Search screen. |
| cols |
number |
Defines the number of columns (vertical or slide layout). |
| rows |
number |
Defines the number of rows per page. |
| lig_edit |
on/off |
Enables or disables the edit icon (pencil) for record editing. |
Common Property (All Applications)
| Property |
Value |
Description |
| exit |
app/URL |
Redirects the application to a specified location on exit. |
Examples
// Example 1: Start "my_form" in insert mode
sc_apl_conf("my_form", "start", "new");
// Example 2: Disable record insertion in "my_form"
sc_apl_conf("my_form", "insert", "off");
// Example 3: Make "my_field" in "my_form" read-only
sc_apl_conf("my_form", "field_readonly", "my_field");
// Example 4: Show "my_field" dynamically in "my_form"
sc_apl_conf("my_form", "field_display_on", "my_field");
// Example 5: Start "my_grid" using the Search screen
sc_apl_conf("my_grid", "start", "filter");
// Example 6: Set "my_grid" to show 20 rows
sc_apl_conf("my_grid", "rows", "20");
// Example 7: Hide "my_field" dynamically in "my_form"
sc_apl_conf("my_form", "field_display_off", "my_field");
// Example 8: Trigger configuration via toolbar menu button
if ({sc_menu_item} == "btn_1") {
sc_apl_conf("form_customer", "start", "new");
}
|