iankh Posted January 31, 2008 Share Posted January 31, 2008 I'm working on a system for room reservations. I have created a global field to act as a preference to allow the user to show past date bookings or hide past date bookings. In my script that goes to the booking listing layout, I have a condition that checks this preference, and then either shows all of the records, or performs a find. This works great, provided there are past date bookings. It however spits out a error that no records were found if there aren't any past date bookings. I'm trying to figure out a way to hide this error and make the behind the scenes find and all transparent to the user. What I want to have happen is that if there are no records that match the find, to just smoothly show the listing, empty of records and pop-up a dialogue box telling them that there may be records hidden based on their preferences. How do I get around the FM system error of no records found and then the whole subsequent FM dialogue box for can, continue, etc? Thanks for your help. Link to comment Share on other sites More sharing options...
David Head Posted January 31, 2008 Share Posted January 31, 2008 Add a Set Error Capture [On] before the find step and the Set Error Capture [Off] after the find. That will trap/suppress all find errors. Link to comment Share on other sites More sharing options...
iankh Posted January 31, 2008 Author Share Posted January 31, 2008 Add a Set Error Capture [On] before the find step and the Set Error Capture [Off] after the find. That will trap/suppress all find errors. Thank you so much! I wasn't aware of that. I'm experimenting with it and it seems to do the trick! Link to comment Share on other sites More sharing options...
David Head Posted January 31, 2008 Share Posted January 31, 2008 So you learned something new. It's a good day! Just be aware that this will suppress ALL errors with the find. No records found (401) is only one of the errors possible. You should be aware of all possible errors and account for them if necessary. Link to comment Share on other sites More sharing options...
iankh Posted January 31, 2008 Author Share Posted January 31, 2008 So you learned something new. It's a good day! Just be aware that this will suppress ALL errors with the find. No records found (401) is only one of the errors possible. You should be aware of all possible errors and account for them if necessary. Thank you. This is a fairly simple find (CheckoutDate >=//) so I think the risk is limited. Would I find the listing of possible find errors in the error code listing in the FM documentation? Link to comment Share on other sites More sharing options...
David Head Posted January 31, 2008 Share Posted January 31, 2008 Yes, the FileMaker error codes are a good study topic. smiley-wink Link to comment Share on other sites More sharing options...
Recommended Posts