Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to catch search problem?

Posted on 2004-11-25
6
Medium Priority
?
304 Views
Last Modified: 2010-04-27
I got a search in filemaker with a script.

But sometimes the # of found records is 0. I want filemaker no to give a messagebox like:

"No records has been found"

[Cancel] [Continue] [Edit search]

Or so, i got the dutch version, don't know what the english version mentions.

But anyway, I want filemaker not to mention that (like catch the error or so) and i want to give my own messagebox. Any ideas???
0
Comment
Question by:Ducolo
  • 3
  • 3
6 Comments
 
LVL 9

Accepted Solution

by:
Lieven Embrechts earned 500 total points
ID: 12674774
Here's a sample of what you can do.
The trick is to Set Error Capture On and Off and check on Get(FoundCount)=0


Set Error Capture [ On ]
If [ Get(WindowMode) = 0 ]
   #We're in Browse Mode: Enter Find Mode
   Enter Find Mode [ ]
   [ Pause ]
Else
   #We're already in Find Mode. Let the Find button function the same as the Continue button.
End If
Perform Find [ ]
If [ Get( LastError) = 400 ]
   Show Custom Dialog [ Title: "Message"; Message: "No find criteria were entered. All records will be displayed."; Buttons: "OK" ]
   Show All Records
Else If [ Get(FoundCount)=0 ]
   Show Custom Dialog [ Title: "Message"; Message: "No records match this request."; Buttons: "OK" ]
   Show All Records
Else If [ Get(FoundCount)=1 ]
   Go to Layout [ original layout ]
Else
   Go to Layout [ "List View" (Employee) ]
End If


0
 
LVL 28

Expert Comment

by:lesouef
ID: 12677791
the last line should be
Else If [ Get(FoundCount)>0 ]
according to me...
no big difference  I agree!
0
 
LVL 28

Expert Comment

by:lesouef
ID: 12677927
I forgot to mention that to simplify what Lieven described, if you set capture on, no more error msg from FM, and that's true for all functions; then you have to test for errors right after the search to display whatever you want; after a search, the simplest is to count the amount of found records of course
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:Lieven Embrechts
ID: 12685776
> the last line should be
> Else If [ Get(FoundCount)>0 ]

Incorrect, you didn't see the else.
When = 1 it jumps to the 1 record layout,
else it jumps to the list view.

> I forgot to mention that to simplify what Lieven described, if you set capture on, no more error msg from FM,
> and that's true for all functions; then you have to test for errors right after the search to display whatever
> you want; after a search, the simplest is to count the amount of found records of course

yes, that's what i said: "The trick is to Set Error Capture On and Off and check on Get(FoundCount)=0"
0
 
LVL 28

Expert Comment

by:lesouef
ID: 12685961
ouppsss, was late.... sorry.
by the way ducolo is a long time user, strange to see him asking this....
0
 
LVL 9

Expert Comment

by:Lieven Embrechts
ID: 12738615
yup, i simply had to open a template, print to pdf, copy/paste.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question