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.

Is there a faster way?

Featured Replies

Is there a faster way of setting up the script below, It runs against about 2,500 records every 4 hours, and it takes a long time to go through.

squatters.zip

Looping can be a slow process. If you only need to update a subset of records, try finding only those records first, then update only those. I can't say specifically how to do this in your file as it's missing the important structural bits.

Also, the Go to Record Request [ Exit after last; Next ] should not be necessary after your Delete Record[]. This will cause the next record to be skipped.

And while looping can be slow, that alone wouldn't explain why this process would be slow for only 2500 records. You didn't say how "long a process" it is (5 seconds?, 30 seconds?, 5 minutes?).

One other thing that can be a slow process is deleting records, especially if there are cascading deletes involved. If you don't need the cascading deletes, you might disable that in the relationship definition.

Another option is instead of deleting the records, mark them as "inactive" or something, and filter them out of your relationships and Finds. This would effectively hide them from users and processes. You could then deleted them for real at some other time (or leave them in there).

  • Author

Ender, Than you for you help. I have added a step in the script to capture the start and end times to be able to provide a better time frame of how long it takes to run the script.

I see your point about the next record step. But if I remove it, then it would compare the next record to the begining of the script would it? Would putting in a pervious record request work better?

There is no cascading deletes, didn't know what that was until this morning, thanks to reading though this form.

I have added a step in the script to capture the start and end times to be able to provide a better time frame of how long it takes to run the script.

So how long does it actually take?

Another minor point, and I don't know if they've changed this in later versions of FileMaker (because I always do it :B-).

A Loop will run much faster if the layout is in Form view at the time. For some reason List view will slow it down, because it thinks it has to update the scroll bar. Freeze Window also helps, but Form view was the key. What I do is View As [ Form ] before the loop, then View As [ List ] afterwards.

Another thing to consider. Could more than one of these If tests be positive? If so then you're wasting time checking the others after it; they would be redundant. If more than one could match, then you should surround the later If tests with a test whether the field is already set to "squatter."

It sounds like this is "more" testing, therefore slower. But it is many times faster for FileMaker to check a local field than it is to check related field. It is also slower when FileMaker has to set the same field more than once.

And, if it could be more than one match, and one of them is more likely, it should be the 1st test.

It also looked like to me that you never processed the 1st record, you immediately went to the Next (or Deleted then went to the next, which skipped).

(P.S. Please test with sample data.)

squatters_fej.fp7.zip

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.