To change the properties of application execution, changing their form of execution than initially planned, Scriptcase has a macro called sc_apl_conf. The macro should be used as follows:
sc_apl_conf ( Application , property , value ) ;
So, we can force a form to start the inclusion mode , or start a query by the filter , etc. .
The macro can be used by on an application to modify the properties of another application . For example , in a register of request, a Seller may register a new request, but can not change it, this case, we would use a type button "PHP", the code below for register a request.
if ( [ users ] == " Seller " )
{
sc_apl_conf ( " apl_request_register " , "update " , "off " ) ;
sc_redir ( apl_request_register.php ) ;
}else{
sc_redir ( apl_request_register.php ) ;
}
Below is a table with the properties and values of the macro :
Properties for Form applications
Properties | Value | Description |
start | new | Force the form to open in mode for inclusion of new record |
insert | on/off | Enables (on) or disables (off) the inclusion of new records |
update | on/off | Enables (on) or disables (off) the change of records |
delete | on/off | Enables (on) or disables (off) the exclusion of records |
field_display_off | field | Disables the display of a field |
field_display_on | field | Enables the display of a field |
field_readonly | field | Force a field to be displayed as "readonly" |
rows | | Force the amount of lines per page (for only forms multiple lines) |
rows_ins | | Force the amount of lines of inclusion (for only forms multiple lines) |
Properties for Grid applications
Properties | Value | Description |
start | filter | Force the grid initiate from filter. |
cols | | Force the amount of columns (grids of type vertical and slide) |
rows | | Force the amount of lines per page |
lig_edit | on/off | Enables (on) or disables (off) the button to edit the registry (pencil) |
Properties for all applications
Properties | Value | Description |
exit | apl/url | Force the application exit to the "application" or "url" informed |
Below are some examples:
Ex1: Force the "my_form" application Starting in the inclusion mode.
sc_apl_conf("meu_formulario", "start", "new");
Ex2: Do not allow the "my_form" application, make adding new records.
sc_apl_conf("my_form", "insert", "off");
Ex3: Displays the "my_field" field of the "my_form" application dynamically.
sc_apl_conf("my_form", "field_display_off", "my_field");
Force the "my_consult" application Starting from filter
Ex4: Force the "my_grid" application Starting from the filter.
sc_apl_conf("my_grid", "start", "filter");
Ex5: Force the "my_grid" application show 20 lines.
sc_apl_conf("my_grid", "rows", "20");
Ex6: Forcing application exit "my_grid" for the application "other_grid".
sc_apl_conf("my_grid", "exit", "other_grid");