Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I wanted to script a Find button for a solution I am writing. I found the following in the Help section of Filemaker pro 11

Set Error Capture [ On ]

Enter Find Mode [ Specified Find Requests: Find Records; Criteria: ClientDatabase::LastName: “Enter Last Name then press Enter Key” ] [ Restore; Pause ]

Perform Find [ ]

If [ Get ( LastError ) > 0 ]

Show Custom Dialog [ Title: "No Records Found"; Message: "No records were found. Click OK to modify your request or click Cancel to return to Browse mode."; Buttons: “OK”, “Cancel” ]

If [ Get ( LastMessageChoice ) = 1 ]

Modify Last Find

Else

Enter Browse Mode

Show All Records

End If

End If

It works well except you can't capture the error in "Modify Last Find" script step if the user doesn't find any records or clicks on cancel. I tried another "Get (LastError)" after the "Modify Last Find", but it doesn't work.

I also tried this after the last "End If"

Go to Record/Request/Page [ First ]

If [ Get ( LastError ) = 101 ]

Enter Browse Mode

Show All Records

End If

Sort Records [ Specified Sort Order: ClientDatabase::LastName; ascending ClientDatabase::FirstName; ascending ClientDatabase::DateFirstEntered; ascending ] [ Restore; No dialog ]

Adjust Window [ Resize to Fit ]

Set Error Capture [ Off ]

I thought if I captured for a found set of "0" that might work, but it didn't work.

Any suggestions. I am sure there is an easy solution but I don't see it

thanks for any help

  • 3 weeks later...
Posted

Unfortunately, you cannot detect if the user clicked Cancel when performing a find.

This is my new favorite method for performing a find: http://sixfriedrice.com/wp/using-onmodeenter-script-triggers-to-display-custom-find-layouts/

This topic is 5066 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
×
×
  • Create New...

Important Information

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