Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

When a find is performed and no search data is entered into the find form and the user clicks on find button in my find layout the find script exits and the user is dropped out to a form layout that I don't want them to access.

Has anyone come across this problem and, if so, how do I control this default action with my find script?

Posted

You need to trap for no records found yourself by turning on error capture, then control what happens, something like:

Set Error Capture [ On ]

Enter Find Mode [ pause ]

Perform Find [ ]

If [ not Get ( FoundCount ) ]

Show Custom Dialog [ "No records found" ]

Show All Records

Go To Layout [ original layout ]

Halt Script

End If

... do whatever with found set

Posted

Thanks for your responses, guys.

This is the script (- the code in [color:red]red is the bit that isn't working. What I'm trying to trap is the event where a user enters no search criteria and then clicks on the find button in my Find Layout):)

Allow User Abort [Off]

Set Error Capture [On]

Show/Hide Status Area [Lock; Hide]

New Window [Name: "Find Material"; Height: 440; Width: 680; Top: 200; Left: 160]

Go to Layout ["find_Material" (lib_Materials)]

Go to Field [lib_Materials::mat_Brand]

Enter Find Mode [Pause]

Perform Find[]

If [Get ( FoundCount ) = 0 [color:red]or Get ( LastError ) = "8"]

Go to Layout ["find_noResults" (lib_Materials)

Exit Script []

Else If [Get ( FoundCount ) > 1]

Perform Script ["list_Materials"]

Exit Script []

Else

Perform Script ["details_Materials"]

End If

Posted

Problem solved - I used the wrong error code!

The relevant line should have read:

If [Get ( FoundCount ) = 0 [color:red]or Get ( LastError ) = 400]

Thanks for being out there, guys. It certainly helps to know there's someone on your side!

This topic is 6671 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.