Skip 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.

Find error dialogue box

Featured Replies

Hi Folks,

I've got a couple of search boxes on the home page which all work fine. When there are no results, I have no problem leaving find mode and returning back to the original layout, but this could cause jitters for my colleagues.

 

I've attempted to set up a way to trigger a custom dialogue if that happens, but I've never done this before and can't get it to work.

I can see problems with the attempt below but have brain fade in fixing it! I think I need to use something like:

 

  • If FoundCount=0
  • then goto dialogue box
  • Else exit script?
Enter Find Mode [ ]
Go to Layout [ “Pupils” (Pupils) ]
Set Field [ Pupils::FullName; Pupils::gPupilFind ] Set Error Capture [ On ]
If[Get(FoundCount) =0]
Perform Find [ ]
Go to Layout [ original layout ]
Show Custom Dialog [ Title: "No matches"; Message: "No matches found for " & Quote ( Pupils::gPupilFind); Default Button: “OK”, Commit: “No”; Input #1: Pupils::gPupilFind, "Find:" ]
End If

A nice touch would be the ability to alter the find string from the dialogue box and search again..

 

Many thanks,

Mike

Get (FoundCount) while still in find mode returns the number of existing find requests so the perform find, Go to layout, Show custom dialog script steps will never execute in your version.

 

My guess is that you want to

Enter Find Mode [ ]
Go to Layout [ Pupils (Pupils) ]
Set Field [ Pupils::FullName; Pupils::gPupilFind ]

Set Error Capture [ On ]
Perform Find [ ]

Set Error capture [Off]
If[Get(FoundCount) =0]

Go to Layout [ original layout ]
Show Custom Dialog [ Title: "No matches"; Message: "No matches found for " & Quote ( Pupils::gPupilFind); Default Button: OK”, Commit: No”; Input #1: Pupils::gPupilFind, "Find:" ]
End If

 

You might want to think about how you will handle the missing Else or Else If clause in your script. You have handled the case where found count is zero.. but what if found count is exactly one? What if found count is more than one? it is common to put the user into a list layout if more than one record is found and put them into the detail layout if only one record is found.

  • Author

Hi Kris,

Many thanks, that's got it working.

Now to learn how to use the custom dialog...

 

Cheers!

Mike

Kris, I don't see the point in SetError Capture (Off)

Kris, I don't see the point in SetError Capture (Off)

 

Rick,

 

When I explicitly supress errors using Set Error Capture[On] I only keep them surpressed for as long as absolutely necessary.

  • Author

thanks for that clarification Rick and Kris.

I did wonder about that.

  • Author

Hi folks,

If come up with this script which works - the custom dialogue gives the option to change the search.

It's the first time I've Else / If type stuff and I'm pretty sure my loop could be simplified, (I've not done anything like this since I was a kid working with BBC Basic!!)

If anyone has improvements on my rough conditional branching I'd be grateful :-)

Enter Find Mode [ ]
Go to Layout [ “Pupil List” (Pupils) ]
Set Field [ Pupils::FullName; Pupils::gPupilFind ] Set Error Capture [ On ]
Perform Find [ ]
Set Error Capture [ Off ]
If[Get(FoundCount) =0]
Go to Layout [ original layout ]
Show Custom Dialog [ Title: "No matches"; Message: "No matches found for " & Quote ( Pupils::gPupilFind); Default Button: “OK”, Commit: “No”; Button 2: “Look again”, Commit:
“Yes”; Input #1: Pupils::gPupilFind, "Enter new search:" ] If [ Get ( LastMessageChoice ) =2 ]
Perform Script [ “Find Pupil” ] End If
End If

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.