Creating a Calculation Field

The invoice line items now calculate their extended prices automatically, because you created a calculation at the beginning of the chapter to handle that. But you still have to add up the extended price of each line item and enter the total amount due on the invoice itself. Another calculation solves this problem.

  1. In the Mars Investigations database, choose File → Manage → Databases and go to the Fields tab. From the Table pop-up menu, choose Invoices.

    The field list shows all the fields in the Invoices table.

  2. Select the Total Due field in the list.

    The Field Name, Type, and Comment at the bottom of the window update to show information about this field.

  3. From the Type pop-up menu, choose Calculation, and then click the now highlighted Change button. When FileMaker asks if you’re sure you want to make this change, click OK.

    The Specify Calculation dialog box pops up. (See Table occurrence context for details on its many features.)

  4. From the “Evaluate this calculation from the context of” pop-up menu, choose Invoices.

    The Invoices table has multiple occurrences on the graph, but since you’ll be displaying the Total Due field on the Invoices layout, you want the calculation to evaluate from this context.

    Note

    When you manage your relationships graph using Anchor Buoy table occurrence groups, it’s a lot easier to figure out the context of your calculations. You’ll create most calculations in the source table for the Anchor TO and they’ll evaluate from that same context. ...

Get FileMaker Pro 9: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.