Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empty Result on Find

Featured Replies

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?

Hi

sure you have to fix something on your script...

Write it down !

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

  • Author

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

  • Author

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!

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.