Child pages
  • Intro to Servoy Concepts

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A calculation is a derived value that acts like another column in the database table. Calculation data is the result of a JavaScript function and is similar to a Servoy method. The main difference is what is available to the function; a calculation function cannot access form variables, values from form elements, or application functions as it is calculated in the data layer of the application. The function does have the current column's data and any related data available to it.

A calculation is calculated when the value is requested, for example when displayed or used in scripting or in another calculation, and the value was not calculated yet or flagged or invalidated.
A calculation is invalidated when one of its inputs changes.
When a calculation is invalidated, an event is fired through the UI so that when the calculation is displayed the UI element will be updated.
When a stored calculation changes, the record will be marked as changed (will be in edited records) and will be part of next save action.

Calculations are stored in the solution data, but are based on a table. Stored calculation values are stored in an actual database column, while unstored calculation values are only derived when used by the application.

...