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.

Field Script calling script in another file

Featured Replies

I have a solution I'm working on that has the data completely separated from the interfaces by way of files. The files have file references as normal. My problem is that I need to have a field exit script trigger a script. No problem with ZipScript pluggin.

But the issue is that when I call the script when it's resident in the data file, it needs to update a field. But that table is open in the interface file that originally modified it, so I get the infamous

"This record cannot be modified in this window because it is already being modified in a different window".

I want to modify the field in the table in the data file to call the script which i copied to the interface file. By the way, the script runs fine in manual mode at the interface.

Check your field definition in the data file; the auto-entry calculation is what triggers the script. It's common to use Get(FileName) here to tell the plugin where the script is. But that won't work when the script is in a different file -- you'll need to hard-code the name of the interface file into the trigger calc.

The record-locking is a separate issue. Normally in the separation model, you never interact with the data file directly. Are you working with multiple users? Are you working with multiple windows that interact with the same record or related records? I'd have to know more about your script and the way you're testing it to address this.

  • Author

Thanks for the follow-up. Sometimes it can feel like a lonely place working on Filemaker.

I found a way around the field calc/trigger problem by creating a stub script in the data file. That script is referenced by the original field, but it merely calls perform script referring to the target file/script.

As for the solution, it's a separation model with multiple windows potentially working from multiple people/workstations. Primarily, it's multiple workstations. For example, a two people will be entering sales orders. But you might also have someone working on new product entries which affects inventory, and two, five or even ten people entering sales, another person doing receiving. All affect the inventory table(s).

Is there something I should be worried about?

the issue is that when I call the script when it's resident in the data file, it needs to update a field.

Is it really??

http://www.fmforums.com/forum/showpost.php?post/282164/

--sd

I probably shouldn't have brought up multiple users - that's a different kind of record locking. My point was that, based on the error message you were getting, there might be something you could change in your script that would correct this, e.g. add a Commit step before you jump to a different window.

It's not necessary to have redundant scripts in your data file. But I'm glad you solved your problem.

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.