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.

Enter text in field & hit enter key to activate database search

Featured Replies

New user

I have a "Search" script setup in one of my layouts, which works well but I'd like to refine it a little to make searching quicker and with less mouse clicks.

Currently, I have a field into which I enter a client name, and a "Search" button which activates a search throughout my database for any records containing this name. For the search to work I have to input the name (or a portion of it) into the "Search Name" field , and then click on the "Search" button.

What I'd like to happen is to enter the name into the field and then hit the enter key to activate the same search. Is this possible?

1279701483_SearchFieldandbutton.png.afd80f2b0d7ba15ca70e5b7a217901d6.png

Thanks in advance.

  • Author

Hi comment, thanks but I have no idea how to implement one of these script triggers and the Claris explanation is quite confusing.

From some of the online info I've been reading, sounds like I need to firstly "capture" the enter key inside a script, and then assign a script trigger to my "Search all records" script? I tried a few times, but I just keep getting the same message: "Before typing, press Tab or click in a field or choose the New Record menu command"

I've attached the script I found, which is assigned to the "Search" button.

Thanks for any further help.

 

Screen Shot 2021-05-02 at 11.47.23 AM.png

Edited by St3v1e

6 hours ago, St3v1e said:

sounds like I need to firstly "capture" the enter key

That is not necessary. The Enter key* exits the field - so you can use any one of the following script triggers:

  • OnObjectExit

  • OnObjectSave

  • OnObjectValidate

6 hours ago, St3v1e said:

and then assign a script trigger to my "Search all records" script?

You assign the script trigger to the field (or more precisely - to the field instance on the layout), not to the script.

--
(*) Note the difference between the Enter and the Return keys. If you want the Return key to trigger the script as well, you must assign it to go to next object (in the Data section of the Inspector). Or indeed move to the OnObjectKeystroke trigger - which would be overkill in this case, IMHO.

 

Edited by comment

  • Author

Many thanks Comment - just assigned the script trigger "onObjectExit" . . . and tried it using the "Enter" key (was using the "Return previously), and it worked first time!

So now I'll follow your instructions to see if I can make it work using the "more commonly used) "Return" key.

 

 . . .  and that also worked!

Problem Solved!

Many thanks as always Comment.

Edited by St3v1e

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.