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.

Updating Fields in Related Tables

Featured Replies

I am not sure about the way Filemaker handles Set Field commands for related tables in scripts. With FM7, we are instructed to Commit Records whenever the Set Field command is used, or else changes will not be recorded. But what happens when you issue a Set Field command on a related table?

My situation is this: I have an Items Purchased table and a Clients table. When a client purchases an item, I run a script that creates the item record and updates the client's account balance. In the past, I simply had:

Set Field["ItemToClient::AcctBal"; "ItemToClient::AcctBal" - ItemCost]

Since the record was in another table, the update was automatic. Now, however, if I add a Commit Record step to this, I don't know which record is being committed. Am I committing the Item record, or the Client record?

I am considering creating a separate SetBalance script that opens a new window, sets the balance, commits the record, and closes the window--but I wonder whether this is overkill. I also wonder whether I will have to add something to my original script to be sure that the change in Client balance is picked up by the Item routine.

Ideas?

You are committing the parent record in the current table. From the online Help: "When you change related data (such as related records displayed in a portal), these changes are not committed until you commit the record that is displaying the related data."

Opening a new window, changing the data, committing the record, and closing the window would indeed be overkill for

Set Field [relationship::field; relationship::field - currenttable::field]

Commit Records/Requests

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.