Jump to content

Scripting a find failure


This topic is 5766 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 5766 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.