• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 3. Layout Enhancements > Using Calculated Field Labels

Using Calculated Field Labels

When you design a layout, you usually include all fields that might be needed, even if some aren't always used. Major changes are best handled by creating another layout, but there can be times when you only need to include (or exclude) a specific field. For instance, you might have designed an invoice layout that includes a discount field. You would only want that field and its label to appear if there is a discount. (Otherwise the customer will want to know why they didn't get one.) By creating a calculated field that contains both the value and the label, you can customize the layout to automatically display or hide the field.

To create a calculated field label:

1.
Choose File > Define Fields (Ctrl+Shift+D/Command-Shift-D).

2.
When the Define Fields dialog box appears (Figure 3.39), type a name into the Field Name text box. Choose Calculation as the type, and click Create.

Figure 3.39. You create a calculation field by giving the field a descriptive name, selecting the Calculation radio button, and clicking Create.


3.
When the Specify Calculation dialog box appears, double-click If in the functions list on the right (Figure 3.40).

Figure 3.40. To place a function in the calculations text box, double-click it in the functions scrolling list. Functions are followed by parameters in parentheses, each of which needs to be specified.


4.
In the Discount Display area, replace “test” in the If calculation by double-clicking it to make it the only highlighted parameter, then double-clicking IsEmpty in the Functions list.

5.
With “field” highlighted in the calculation, double-click the field you want to designate in the fields list on the left side. This example uses the Discount field (Figure 3.41).

Figure 3.41. To specify what field to use in a calculation, double-click it in the field list on the left.


6.
Double-click to select “result one,” then click the quotes button in the Operators keypad (Figure 3.42).

Figure 3.42. The most frequently used operators are controlled by the keypad. In this example, Quotes is indicated on the keypad.


7.
Double-click to select “result two,” then click the quotes button again. Type the name of your label between the quotes. In this example, the label is “Discount.”

8.
Move your cursor between the last quote and the parenthesis and click the ampersand button. Add the NumToText function by double-clicking it in the right functions list.

9.
With “number” highlighted in the calculation, double-click the same field you chose in step 5. This example uses the Discount field.

10.
Move your cursor between the two close parentheses. Click the ampersand (&) button, the quotes button and type % between the quotes.

11.
Click OK to save the calculation (Figure 3.43), then click Done to close the dialog box.

Figure 3.43. Click OK to save the finished calculation.


12.
Go to the layout where the new field will be displayed and switch to Layout mode (Ctrl+L/ Command-L).

13.
Add the new field to the layout.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint