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.

No records found = 401 = Filemaker script error

Featured Replies

Any way to surpress the error message when you have a script that searches and finds nothing when run from the server? Its not an error it just hasnt found any records!

Turn error capture on. It's a script step.

Edit: oops, the "server" part didn't register!

If you are referring to the error FileMaker server logs, then no, not that I'm aware of.

  • Author

Turn error capture on. It's a script step.

It's on.

If you are referring to the error FileMaker server logs, then no, not that I'm aware of.

ridiculous... lol Sort it out Filemaker.

After your find request...

If Get(lastError) > 0

action for failed find

Else

action for successful find

End

  • Author

After your find request...

If Get(lastError) > 0

action for failed find

Else

action for successful find

End

This does not surpress error messages in the main schedule screen

This is kind of janky, but you have to insert in a script step that guarantees no error code thrown (like "Show All Records") and then exit the script using the "Exit Script" step.

ie.




If Get(lastError) > 0

  action for failed find

  Show All Records

  Exit Script

Else

  action for successful find

End If



If you have multiple "Perform Find"s, make sure you add the "If Get(lastError) > 0" right after the Perform Find and then "Show All Records" and "Exit Script" steps after your other script steps but before the "End If" or "Else" script step.

This suppresses the error in the schedule section of FMS

  • 9 months later...

My server side master script calls three scripts, each of which ends with a Find All Records step.  If the script specific find does not find any records it jumps to the Find All Records steps and ends.  

 

The FMS 12 server side logs faithfully records each of the 3 called scripts as having a 401 error in spite of the non-erroring Find All Records step at the end.

 

I too would love to get rid of these logged errors.

You also get a logged error at the end of every loop. (Go to Next, Exit after Last).

  • 4 months later...

 

From: http://www.databuzz.com.au/an-approach-to-filemaker-server-side-script-debugging/

 

You can use the following step immediately above the Go to Record/Request/Page [ Next ] step to bypass this:

Exit Loop If [ Get (FoundCount ) = Get (RecordNumber ) ]

 

… but if you do that, you should set a variable to the value of Get ( FoundCount ) before starting the loop and check on that, so Get ( FoundCount ) is only executed once, not for every iteration. 

 

or rather not … see below

so Get ( FoundCount ) is only executed once, not for every iteration. 

 

Have you tested this to see if it makes a difference?

… but if you do that, you should set a variable to the value of Get ( FoundCount ) before starting the loop and check on that, so Get ( FoundCount ) is only executed once, not for every iteration. 

 

OK; contrary to popular belief (or at least my belief) it doesn't seem to make a difference – and for large data sets the variable method even seems to be slower … any idea why that would be the case?

 

Anyway, thanks for pointing this out.

OK; contrary to popular belief (or at least my belief) it doesn't seem to make a difference – and for large data sets the variable method even seems to be slower … any idea why that would be the case?

 

I have only a guess. First, the belief that Filemaker would count the records every time you call for Get(FoundCount) is rather naive; even simple browsing would become unbearably slow if the record counter in the tool bar had to be refreshed that way. It is much more reasonable to assume that the found count is kept in a register (i.e. a dedicated variable) that gets updated only when the found set is actually modified. So one would expect to see very little difference between reading the register compared to reading a $variable. It's even possible that reading the register would be a tad faster - seeing that it's been hard-wired since version 3 if not sooner, while script variables need to be registered and Filemaker must look up the registry before it can retrieve the value.

 

Again, this is no more that a conjecture - but if it's borne out by facts, then it's a good conjecture until someone comes up with a better one.

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.