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.
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.
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.
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.)
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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access