Something else must be wrong with your script.
I tried the following test:
Perform Quick Find [Globals::GlobalField]
If [ Get ( FoundCount ) = 0 ]
Show Custom Dialog ["no records found"]
and when I put text into the global field that did not match to any field/record in my database, I got zero records in my found set and the custom dialog appeared.
Perhaps some other aspect of your script is keeping the If block from ever being executed.
Hmm ... I wonder what it could be. I use the same script when I run a regular find and it works. But, it doesn't work with the Quick Find. I will try rewriting the script and see what happens.
You can also post the script here for others to examine.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
I tried writing the script from scratch, but still come across an issue with the zero result. I was able to change the result by removing some items, but it's still not working. Instead of showing the custom dialog, a FileMaker pop-up shows up and then ignores the rest of the command. (If Error Capture is not on). The result of 1 and greater than 1 do work. Just not the 0. See below for my script.
Sorry ... I uploaded the wrong file. Here is the script. :)
I see no errors in your script, but are you sure that this is the script that you are performing? The error message that you posted does not appear when Perform Quick Find fails to find any records. That error message pops up if Perform Find is executed and no records are found.
On a technical note, whether you use perform find or perform quick find, once that step has executed your FileMaker window will be in Browse mode in either case. Get ( FoundCount ) and any other function or calculation in your script steps should then evaluate in exactly the same way.
Yes, that is the script I'm running. I even stripped it down to the attached and still get the FileMaker error about no records matching the find request. Must be a bug?
It's my first Show Custom Dialog command that is messing it up. If I remove that, it works. I tried renaming the dialog box and that didn't make a difference. Strange...
What mode are you in when this script runs?
Is g_QuickFind a field with global storage?
Here's my script and the dialog box produced. I'm using FileMaker 13 on Windows 7.
I took a closer look at things and this is the system error message not the custom dialog that I am looking at.
When I examine my layout after running the script, I see that I do not have an empty found set. Unlike Perform Find--which I almost always prefer over Quick Find, a failed quick find does not produce an empty found set and thus the script is working correctly, it's just not producing the results that you expected.
Try this Script:
For this testing, I am in Browse mode. Though I run it in Find mode as well. Yes, g_QuickFind is a field with global storage. I'm using FileMaker 13 on Mac.
Maybe I'm looking at your images wrong, but it looks like you get a FileMaker error instead of your Custom Dialog. Is that right? In which case, we would have the same problem.
If I remove the Custom Dialog box where I input the criteria into the global field, it works fine.
Thank you! That did the trick!