September 11, 201213 yr 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!
September 11, 201213 yr Turn error capture on. It's a script step. Edit: oops, the "server" part didn't register!
September 11, 201213 yr If you are referring to the error FileMaker server logs, then no, not that I'm aware of.
September 12, 201213 yr 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.
September 12, 201213 yr After your find request... If Get(lastError) > 0 action for failed find Else action for successful find End
September 18, 201213 yr 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
September 26, 201213 yr 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
June 27, 201312 yr 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.
June 27, 201312 yr You also get a logged error at the end of every loop. (Go to Next, Exit after Last).
November 8, 201312 yr You also get a logged error at the end of every loop. (Go to Next, Exit after Last). 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 ) ]
November 8, 201312 yr 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
November 8, 201312 yr so Get ( FoundCount ) is only executed once, not for every iteration. Have you tested this to see if it makes a difference?
November 8, 201312 yr … 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.
November 8, 201312 yr 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