Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Help !! - run a script when a field changes


This topic is 8151 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 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

Link to comment
Share on other sites

This topic is 8151 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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