May 3, 200223 yr 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.
May 3, 200223 yr 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
June 11, 200223 yr 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
June 12, 200223 yr i suggest a plugin for this, as this is a soarly missed feature that FMP does not have. i have used doScript, it also works with portals well, http://www.interactiveink.com/html/doscript.html. this is mac only though. there is another called SCRIPTit that is cross platform i believe, http://scriptit.cnsplug-ins.com/.
Create an account or sign in to comment