Inside Time Matters: Calculated Fields
Calculated fields were introduced circa Time Matters 4. A calculated field is a field type defined in the field properties of the form style and has its value derived from up to 4 other fields. The result can be formatted as a Text, Number, Money, Date, and Time display formats.
Calculated fields in Time Matters are much different than other software applications. Most applications treat calculated fields as virtual information, derived at runtime. In contrast, Time Matters stores the result of the calculation in the database and does not continually calculate the value at runtime. This method has its share of cons but some very significant pros.
The Pros
- These fields can be sorted in data lists
- Filters can use these fields
- External reporting tools can use these fields
The fact that calculated fields are pre-calculated and stored in the database creates more opportunities to use these fields in runtime operations.
The Cons
- Data cannot be changed from outside the application
- Execution of the calculation can be time consuming
- Calculations are not enforced
It is very important for consultants to understand that changing Time Matters data without using the DataLink API will result in uncalculated data. It’s possible for calculated fields to get out of sync or not current. There are at least five actions that instantiate calculated field updates. They are:
1. Creating a new calculation
2. Revising an existing calculation
NOTE: When adding a new or revising an existing calculated field, a prompt will ask if entire database should be recalculated. If no is selected, the status of the calculation in the remainder of the database will be unknown.
3. Anything that changes a record from inside the program: open/save, process change, trigger, etc.
4. SQL stored procedures know that when they change data that calculated fields need to be updated. For instance, the Follow Flag stored procedure checks to see if a record’s date was changed and if this record has a calculated field on the date.


