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");*