mbust, can you perform the same actions in the first script with just php?
If not, how are you calling the script? Can you post any of your code?
-- sent from my iPhone4 --
Thanks for answering. Yes, it is possible, I suppose (but I'm a beginner with PHP). I could run a simple search from PHP that returns all the records that I need to find (I can do that). But the search is very slow because the database contains a large number of articles, and each article is between 16K to 25K characters, so returning all those characters from that query can take sometimes ten minutes or longer. I would like to search using PHP instead of a FM script, but I would need to change layouts with PHP and don't know how. (So only the title of the article is returned, not the actual text of the article that was searched). As I understand, FX.php can search one layout and return another, but not the API. If there were a way to do this using only the API (as I said, to do a search in a layout and then return the results using another), I would love to know how.
In any case, I'm very much frustrated that a FM script will execute to the end but skip steps in the middle. That seems to me to be problematic. It should break and let you know, but not keep executing steps as if nothing had happened, especially, if all the steps are server-compatible.
Thanks for the help!
1 of 1 people found this helpful
There are two types of errors a server can encounter when running a script: an unsupported script step or a script step that returns an error code. For example, Server can't respond to dialogs so any script step that is set to produce a dialog is not supported. While Perform Find is supported it could return an error just as it would while running on the client.
Setting Allow User Abort to On will abort a Server script if it encounters an unsupported script step. General error handling should be used to deal with the second type of error. Use Error Capture [On] and deal with errors as they could happen.
Specifically with your problem, I'd look in two places:
1) Is the "Perform without dialog" checkbox checked on the Replace Field Contents script step?
2) Are you sure you have a found set to operate on?
You can test #1 by adding some tests to your script. For example, you could set a utility field to the found count and then exit.
You can also get some clues on the PHP side by using echo and the variable you used to call the FM script.
I got it! It was a permissions problem. I had been running with error capture on, and had tracked some of the errors (actually no error), but after your email, I added a number of variables just after the problematic steps (should have thought of that earlier!), and sure enough, I was running remotely with a different set of privileges than I was testing with PHP, so PHP was tripping (error 200, access denied).
Thanks for the help!