Jump 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.

Featured Replies

Hi all,

I'm current running a script on FileMaker Server 2024 every 15 minutes. It starts by going to a layout where the primary table is an ODBC connection to the MySQL server of a website (left side of image). On the layout is also a portal (right side of image) which is the relational data in the FileMaker database. It's a basic relationship using the EmployeeID and Email to match records on both sides.

The left side data consists of users who have registered on the website (WordPress). The right side is the FileMaker membership database used by the staff to maintain membership records. When this script runs, it goes through all the records on the left (basically all the users on the website) and compares it to the data in FileMaker. For each record on the left (MySQL), the script looks to see if there is a related record on the right side (FileMaker).

If there's no record in FileMaker or someone is marked as "Inactive", SQL code is entered into the Access Level field which blocks the user's access on the website. It will also permit access depending on the criteria. It works very well and only takes about two minutes to run through 700 records. 

I am starting to get some intermittent time out errors (error 691) on the server. It ran fine for a week, and I am now getting more errors about once an hour. I was wondering if anyone had any suggestions how to troubleshoot this?

image.thumb.jpeg.89e6e139288e6b72954d9ad040eb7d07.jpeg

 

image.thumb.png.ee9d7947980eeec19feb2c6469b518ec.png

image.thumb.png.d717852402f8f486c29c3f71f37af4da.png

image.thumb.png.bcf3f37f1802ab56c34c3792389ce571.png

I don’t see anything inherently wrong with this script and I would remove the use of global variables in exchange for local. It can be optimized by entering find and then going to a layout. You do not need to show all before finding. You’re not trapping for find errors after line 9. Is line 5 getting a value from a summary field? What’s the definition of the field referenced on line 21? You’re not handling finding more than one record. I’d exit after last On, even though you should exit just before. Can’t see subscripts, but hopefully they don’t rely on the global vars. It’s better to pass parameters. 

sorting may also cost performance  I do not see its purpose and would remove that step.

and overall, a lot of set fields in a loop is a lot of commits. You’ll substantially improve performance If you wrap in a transaction. 
 

more suggestions : think about having just one script that uses the send mail script step and pass parameters to it. This way, if and when you switch to a different method you only have one place to refactor. 
 

at line 21 and 41 what are you doing? Are you checking for a related record? Better method would be to use not isempty (relationship ::primary key). 

  • Author

Thanks so much for your detailed suggestions!

  • I fixed those global variables, it's an old bad habit.
  • I'll take a look at passing parameters to a single script. 
  • The sorting was originally for testing, I have removed it.
  • "I’d exit after last On, even though you should exit just before." - So I was doing this, but I kept seeing a 101 Error in the server log. It is a correct error, but was driving me nuts, so that's why I used that approach.
  • "You’ll substantially improve performance If you wrap in a transaction. " - I will take a look at this as well.

Again @bcooney, thanks so much for the help!  

 

Create an account or sign in to comment

Important Information

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

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.