On exactly which line do you get that error?
And have you tried using FileMaker Advanced's script debugger to watch this script execute step by step?
It's possible that your script is tripping a script trigger and error may occur with in the script performed by the trigger.
This script is intended to run Server side. I run this as a schedule from the FM Server Web Admin portal. Does the FMS Web Portal have a script debugger?
But I THINK i found the issue. If you notice at the end of the script, it does not return to the original layout where it supposed to find the ObservImages::processcount = 1.
So trying that now.
So I added the Go to layout [original layout] and it didn't give an error, but it went on an endless loop.
And it didn't even proceed to the next record which is odd.
What's the best way to debug a script that is meant to run as a schedule on a FM Server?
Yes, you need to return to the original layout and that's the problem, it looks like.
But for future reference, you can always run a PSOS script from the client while in the debugger. You do have to keep in mind the client vs. server side differences, but it can still be enlightening.
I have tried the PSOS but I still can't see what is going on step by step. So it is no different than running the script from the Server no?
Or is the difference here is that I can manually stop the script?
Sorry, when you said "server side", I assumed that this was a PSOS script.
What I am saying is that if fixing the script to add that go to layout step still does not resolve the issue, you can run the script client side, NOT PSOS, NOT from a schedule, so that you can use the debugger to step through it.
The change in context can make a very large difference in results, but it still may help you spot an issue that you did not anticipate in your design of this script.
Thanks Phil. I will give that a try and see what I get.
So I ran the debugger locally, but I can't pin point it. I have to skip a lot of the parts that run on the Server Side, but after I skip those, it behaves the way it is supposed to... ...
This is driving me nuts.
I see where you are using get ( LastError ) in more than one place.
Which field is showing the 401 error code?
Does it appear in every record? Just some? or ???
In neither. I get the 401 error from the Server Logs.
The Get(Last Error) don't show anything
So after messing with the script, it completed successfully and performed the way it should be.
The thing i changed was instead of
Go to Layout [original layout], I did: Go to Layout [ 'ObservImages' (table name)]
and it worked.
Why it needed the specific layout in there, no clue. But it works now.
1 of 1 people found this helpful
that actually makes sense. "ObservImages" is not the original layout. The original layout is whatever layout is current just before line 5 takes the script to the ObservImages layout.