wheri.blogg.se

Filemaker pro 11 scripts examples
Filemaker pro 11 scripts examples











You will see changes made in the portal immediately reflected in the JSON, and vice-versa.(Why would you want to do this? One use case would be to provide dynamic scrollable selection criteria for a report.)Īt any rate, today we’re going to take a look at a little proof-of-concept I threw together to enable portals to display and edit data in JSON arrays. In a real-world implementation, the JSON would likely be sitting in a $$variable, which, among other things, would help make the technique multi-user friendly. Here, in the interest of simplicity, I’ve opted to store the JSON in a regular text field. If anyone has a solution for this, or a way to cause the script to run asynchronously in the background, please let me know.Have you ever wished you could connect a portal to a JSON array? Portals and JSON arrays seem like they should be a natural fit, but FileMaker doesn’t offer us an obvious way to connect one to the other. While you can set the timeout to be very low (add arguments -output /dev/null -silent -head -fail -connect-timeout 1), it still causes a delay to the user of a second or so, which can be noticeable if a user is editing lots of records.

filemaker pro 11 scripts examples

One caveat with this approach is that FileMaker is frozen while the shell script executes, which in this case means until curl either receives a response or times out. Now whenever a record is modified in that layout, the Sync script will run which executes the AppleScript which executes the shell command curl, sending a GET request something to the effect of: curl įrom there, create a sync.php to do something intelligent whenever it’s loaded, using $_GET and $_GET and $_GET or similar passed-through variables. In the resulting Layout Setup dialog, go to Script Triggers and for the event OnRecordCommit, select the Sync script you just created. To cause this to execute when something changes, go to File » Manage » Layouts and select the layout where a user might be editing a record, then click Edit. Note all the quotes and escaping of quotes. GetAsURLEncoded( Get( LayoutTableName ) ) & "\""

filemaker pro 11 scripts examples

"\\\&layout=" & GetAsURLEncoded( Get( LayoutName ) ) & "\\\&table=" & In the Script Step Options, I set my Perform Applescript to be a Calculated AppleScript, and set it as follows: "do shell script \"curl " & Get( RecordID ) & I created a FileMaker script called Sync and gave it one action: Perform AppleScript (obviously this works on Macs only you can achieve something similar using Send DDE Execute in Windows).

filemaker pro 11 scripts examples

I was working in FileMaker Pro 11 so Insert from URL wasn't an option (though how I wish it had been)!

filemaker pro 11 scripts examples

I had a similar problem, where I wanted a FileMaker action to trigger a script that would alert a website that something had changed.













Filemaker pro 11 scripts examples