Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Field calculation from related table

Featured Replies

  • Newbies

New to FM11.

I have a pretty simple invoicing database that uses two related tables "EquipmentBilling" and "Invoices"

"Invoices" has a calculation field Discount that determines a discount based on what department

a user is from:

If ( EquipmentBilling::Department <> "25380000" ; 0;

If (Equipment_Used="Imaging Core Computers"; 0;

If (Equipment_Used="Fortessa Flow Cytometer"; 0;

If (Equipment_Used="Training"; 0 ;Cost * .75))))

The problem is that processing of the first line of this calculation, I guess passing the value of the department from the related

EquipmentBilling to Invoices appears slow. So a database user enters a record but no discount is applied even if the department is

"25380000" as entered into EquipmentBilling. Deleting an entry from Invoices corrects the issue and the Discount field is subsequently evaluated correctly; but this is very kludgy.

Any advice greatly appreciated.

1) A change in a related table will only update an unstored calculation. Sounds like you're using an auto-enter calculation.

2) Case() is your friend here.

"Invoices" has a calculation field Discount that determines a discount based on what department

a user is from

The actual calculation doesn't look like that's what it does. In any case, you should not be hard-coding data inside a calculation formula. For example, to determine a discount based on the selected department, you should assign a discount rate to each department in the Departments table and look it up from there. This will enable you to modify a department's discount rate without affecting existing invoices.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.