Using Formulas
c32b572f-b04c-4bab-a9e4-820ca6dd3845
The formulas can be used in the preparation of calculation procedure, in roles, in fields and in other formulas.
• | To use them in procedures, you must access Calculation Procedure, including the desired formula. |
• | You can use them in a role, but to do so, you must enable the TOTVS Help Desk, in order to clarify and follow-up the necessary procedures. |
This because the formula must be included in the source-program, in the following syntax:
• | fFormula (cFormula,lExibe ) |
Parameter cFormula is the code of the formula that you wish to execute; and parameter lExibe, if you wish to display the message of formula execution.
Example:
You need to display certain report, the employee's incorporated salary. To do so, the formula call 'S_SALINC' must be added in the report source to return the incorporated salary. To execute the formula, you must enter the following call:
• | fFormula ( 'SALINC' , .F.) |
• | To use the formula in another formula, enter the code of the formula that you wish to call in fields Result, 1st Expression or 2nd Expression. |
Type |
Result |
Operator 1 |
1st Expression |
Operator 2 |
2nd Expression |
Operador 3 |
Execution |
SCargaSRC() |
|
|
|
|
.END. |
Example:
• | The formula can also be used in a field, informing the same syntax used in the call of a formula in a role. |
• | fFormula( cFormula,lExibe ) |
Example:
Once the employee's salary is informed, the system must calculate and update some fields of the screen using formula 'S_ATUCPOS'.
For the formula to be executed, the employee must inform the following syntax in the validation of the field, via Configurator environment:
• | fFormula ( 'ATUCPOS' , .T.) |
In this example, to update the fields in the screen, role \"SetMemVar()\" is used, in the formula structure, since it only updates the fields in the screen.
If there is the need to use a formula in the field updating the table fields directly, this formula must be prepared for this update, that is, it must include the position of the table, register lock, etc.
7bc85836-e62f-4641-b7ab-ba205ed649f0Important: Contact TOTVS Help Desk for more information. |