Christopher Kiernan Posted December 6, 2005 Posted December 6, 2005 Hi, I have a script that has Filemaker perform a find request. The only problem is that when the the requested data can't be found Filemaker shows an ungly error message with various options. Basically what I want to happen is either for the script to simply end when the find fails or I want it to show some kind of a custom dialog. My problem with doing any of this is I can't figure out to put a condition in my script that says if the find fails then do this. If anybody could help I would be most appreciative.
aaa Posted December 6, 2005 Posted December 6, 2005 Try Use Set Error Capture[off,on] script for your problem may be it will help you. To me its help.
Christopher Kiernan Posted December 6, 2005 Author Posted December 6, 2005 Hi, thanks a lot for your help. your suggestion did exactly wat u said it would and has solved one of my problems. turning error capture on does get rid of the ugly error message like i wanted but howver it is causing a couple of other problems. Is there anyway of simply telling scriptmaker to do something if it finds no results. What I am thinking about is using an If clause. So for example If find returns no results then do this. If you have any ideas please write back.
mdpres Posted December 6, 2005 Posted December 6, 2005 A simple find script would be. SetErrorCapture [On] EnterFindMode[] // you need to set your find mode to pause //do your find PerformFind[] If[Get ( LastError ) = 401] ShowCustomDialog ["No records match this find request"] ShowAllRecords EndIf From here you can add any number of options. Hope this helps. Dean
Christopher Kiernan Posted December 6, 2005 Author Posted December 6, 2005 Hey, Thanks so much. That's exactly what I needed. The script works just the way I wanted now. If you don't mind me asking you one last question though. In a custom dialog with an input field is there nayway to make it so that a user has to enter a value. Well anyway thanks so much for your help.
mdpres Posted December 7, 2005 Posted December 7, 2005 Hey, Thanks so much. That's exactly what I needed. The script works just the way I wanted now. If you don't mind me asking you one last question though. In a custom dialog with an input field is there nayway to make it so that a user has to enter a value. Well anyway thanks so much for your help. Yes in custom dialog use the field you want to do the find on.
Recommended Posts
This topic is 6929 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now