You can acheive this a number of ways, perhaps by introducing conditional (if) within a script that includes your search, or perhaps you may want to create relationships based on fields entered and then you can test on the related data. All of this may depend entirely on the criteria that you are trying to match, when you want to test the result etc... perhaps a little more info on what you're aiming for might help me give some advice, I hope this helps!?
You don't give much detail about your needs, so here's a quick pointer towards a common direction for error capture.
As your script opens, Set error capture[ on]. This will inhibit the FileMaker alerts.
Then after your script performs each Find, check for errors. Something like,
Set variable: $error= Get(lastError)
It's a bit of a blunt instrument to simply exit the script though. You can be more helpful to your user if you Show Custom Message before exiting, or even create another script to run in the If[$error] condition. An "Error Feedback" script that tells the user what happened. You could pass the $error, which is the 401 code, to the script and interpret it for your users in a way that makes sense to their current task. Inserting the script at each error point makes it a tidier script for you as developer. Todd Geist of Geist Interacive did some very helpful work on this which you should check out.
Camden, Maine, USA
Thank you Frank, I am working on a tidier solution but this will be my plan B.
1 of 1 people found this helpful
Well, you can use the freeze window step to freeze your window when you start the script and, upon error (using error capture), you can return to whatever layout you want and they won't see all the window changes. Or you can do it in a small window off monitor. For example, I'll make a 1X1 pixel window (technically it won't go that small, but you can still specify it) that is at -200 pixels (or 200 pixels to the left of the left hand margin) and do things in it and when done, return to the start window.
Taylor's suggestion is a good one. Not only will the user not see the interactions taking place, but the script will run faster to boot.