88 IBM Workplace Forms: Guide to building and integrating a sample Workplace Forms application
Calculation by decision
In our Sales Quote example we want to add a multiplication calculation to the amount field of
the item based on the quantity and item the user selected from the product list. To accomplish
this, we will use the formula wizard in the Workplace Forms designer by following these steps:
1. Open the Properties window for the first field (FIELD12) in the Total column of the Product
section of the traditional form.
2. Click the Add Formula button in the
Field Contents section on the General tab as seen in
Figure 4-24.
Figure 4-24 Properties box of the Total field
3. Select set by a calculation of two values from the drop-down.
4. In the Formula section, as seen in Figure 4-25:
a. Select value of from the first drop-down; a hand icon will appear, click it.
b. On the form page that is now visible, choose the first field in the quantity column.
c. Select multiplied by in the middle drop-down list.
d. Select value of from the second drop-down; a hand icon will appear, click it.
e. On the form page that is now visible, choose the corresponding price field.
f. Exit the Calculation window by clicking OK, then exit the Properties window by clicking
OK.