Table of Contents

Using Calculations

This chapter describes how to use iDocs’s calculation features. iDocs automatically performs calculations when you fill in the appropriate fields.

Use calculations to automate data entry and prevent errors. For example, the average person might find it time-consuming to add a column of 100 numbers, and easy to make an error, but iDocs can return an error-free sum in a fraction of a second. All you have to do is define the calculation properly and iDocs does the rest of the work.

This chapter contains the following sections:

Calculation Overview

This section gives an overview of how to create calculations. It contains the following topics:

See the online tutorial for step-by-step instructions on creating a simple calculation.

Creating a Calculation

Calculations are created in design view. You can create a calculation for fill text, comb, check box, and circle text objects.

You must open the calculation toolbar to begin.

To open the calculation toolbar:

You can also use the Calculation List dialog box to change your calculations.

The Calculation Builder

The Calculation Builder dialog box contains operators, a list of all the fields in your form, and functions for creating calculations.

To define a calculation with the Calculation Builder:

Suppose you wanted to create a calculation for a Subtotal field in an invoice. The Subtotal field is the sum of the Price1 and Price2 fields. There is often more than one way to create a calculation. Here are two calculations you could create:

Both calculations return the same result. The first calculation is simple addition. It is easy for new users to create.

The second calculation uses the Sum function and is more complex than the first calculation. This calculation is useful for adding multiple fields because you do not need to place the Addition operator between them.


iDocs automatically inserts the necessary parentheses, brackets, and commas when you create a calculation using the Calculation Builder. See “ Calculation Guidelines” .


Auto Calculations

To create an auto calculation, iDocs looks for such common field names as Quantity, Price, Total, and Sum. It also determines calculations based on field type, field names, and column header labels. If you selected a field named Total, for example, iDocs would look for fields above the Total field to sum.

This is one reason it is important for fields to have unique names. See “Defining Objects on a Form” for detailed information.

To create an auto calculation:

The Calculation List

The Calculation List dialog box lists all of your form’s calculations and allows you to make changes to the calculations.

To change your calculations:

Using the Recalculate... Command

Recalculating records applies any new or changed calculations to all selected records in a database. Until you use the Recalculate… command, new or changed calculations apply only to new records or to current records whose relevant field entries change.

See “ Recalculating Records” for detailed information.

Calculation Guidelines

Keep these guidelines in mind as you work with calculations:

Usage Conventions

Substitute the appropriate field name where you see num and str in the function examples. Parentheses are required where indicated. Below is a list of conventions showing operator and function usage.

Operators

Operators represent mathematical, comparison, logical, and text operations to be performed within a calculation. You must have an operator between fields in a calculation.

For example, a calculation for a Total field might look like this:
[Price1] + [Price2] + [Price3]
The plus signs between the field names are the Addition operators in the calculation.

The calculation could also look like this:
Sum([Price1],[Price2],[Price3])

The parentheses are the operators in the calculation. Commas, although not operators, also separate the fields.


You must insert the proper parentheses, brackets, and commas when you create a function manually or iDocs will not accept the calculation. See “ Calculation Guidelines” for detailed information.


iDocs automatically inserts commas, parentheses, and brackets when you create a calculation with the Calculation Builder or the Auto button, and when you click the Accept Calculation button.

Operator Buttons

See “ Calculation Overview” for instructions on creating calculations.

Operators — Quick Reference

See “ Usage Conventions” for information on how to interpret the examples in the following table.

Functions

Functions are single words used by iDocs to represent operations within a calculation. Functions can use field values, information you enter, and information from outside sources such as the computer date.

Please refer to the online help for a definition of each function and instructions on how to use a function in a calculation.

See “Creating a Calculation” for instructions on creating calculations. See “Usage Conventions” for a list of the conventions used in this chapter.

The format of the values returned in the examples is dependent on:

Functions — Quick Reference

See “Usage Conventions” for information on how to interpret the examples in the following table. Or, refer to online help for an example of each function. The following table lists a brief description and usage of each function.

Functions Sorted by Type

The following table lists each function by type. (The Calculation Builder dialog box contains folders for each type of function listed.)