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.

Help !! - run a script when a field changes

Featured Replies

Hi,

Does anyone know if it is possible to run a script when the value of a field changes.

I have a basic order process of a order -db which has a portal to orderitems -db .

Basically the orders -db holds the portal linking to the order items (linked on the orderid).

the orderitems calls up the delivery format from the orders database and then works out the delivery costs etc.

trouble is, if they change the delivery format it only updates the formats - the prices etc (which are lookups) don't update.

I understand that you need to flip between browse and preview mode - is there anyway of doing this with a script that is triggered by the format type changing. My background was previously SQL Server and you could set an 'onChange' type trigger that ran a stored procedure (script) if the field changed.

Any help would be greatly appreciated.

Lewis.

The answer in a single word is no. FMP does not respond to events as such. I don't know about the MAC version, but this is certainly the case in windows.

However, not all is lost. You can get a schedular plug-in which will trap for the tab key press to change fields, or arbitrarily run every x microseconds, and thus activate a script.

Alternatively, you can create ascript which will re-lookup the data. This might be a subscript in any other script which allows the user to navigate away from the current layout. In effect, you are using the human as an event trap.

I noted your use of lookups, would a related field not be better for this setting? at least this would update automatically based on some criteria.

hope this helps

  • 1 month later...

I had posted something like this last year and got help. I had some fields that I needed to know when they changed. I created a text field and put the following in the Auto-Enter calculation:

"X" & Left(Field1 & Field2 & Field3 & Field4 & Field4 & Field5 & Field6 & Field7,0)

Substitute the Field(*) to the fields that you want to watch.

This isn't exactly what you wanted, but this at least puts an "X" in the field that you created when one of the fields change. Then maybe you can make it call a script when that field is not empty (maybe the "not isEmpty" command).

Hope this helps

DaveC

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.