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

Featured Replies

on FMA11, How do you run script when user keystroke "enter"?

I have a text field that ONLY when user keystroke an "enter" the script will run. nothing else matter.

i tried

1. OnObjectModify = script runs right after first letter typed/modified = not good

2. OnObjectValidate = script run even without "enter" keystroke = not good

3. OnObjectEnter = script run right after field activate/ no "enter" keystroke necessary = not good

4. OnObjectKeystroke = script run with any keystroke not just "enter" keystroke = not good

5. OnObjectSave = i dont know what this for = definitely not good

6. OnObjectExit = script run when exiting field not by 'enter" keystroke = not good

HELP

4. OnObjectKeystroke = script run with any keystroke not just "enter" keystroke = not good

Script runs with just "enter" if you use:

If [ Code ( Get ( TriggerKeystroke ) ) = 10 ]

-- Do what you want --

Exit Script [ Result: 0 ]

End If

  • Author

thanks,

but i realize that the script runs every single time user pres any keystroke.

is there a way to run the script at the end of editing the field? with OnObjectExit maybe?

ONLY the first step of the script runs every single keystroke... it is necessary to evaluate wich keystroke was pressed.

Why do you want to intercept the "enter" key ?

thanks,

but i realize that the script runs every single time user pres any keystroke.

is there a way to run the script at the end of editing the field? with OnObjectExit maybe?

That would be on objectSave.

That would be on objectSave.

How do you trap the "enter" key with that trigger ?

How do you trap the "enter" key with that trigger ?

That's how commit works. That's the action that *causes* the save.

But I agree - what's the real purpose here. The keystroke method does exactly what he's asking for and then he's not happy. So what does he really want? Hard to tell.

  • Author

i got it to work guys, thanks for all the help

Yo u got what to work? Which technique did you use?

  • 3 years later...

Bumping this because I think I am having a similar problem but it seems like it would be a common issue and simple fix.

 

I have a data entry layout and a search layout. 

When you click the Search button on the data entry layout, it calls a script (SearchClients_Start) that performs these actions:

  1. Go to Search Layout

  2. Enter Find Mode

 

In the search layout (now in Find Mode), I have set each field to

Set Script Triggers

  OnObjectKeystroke

Perform Script SearchClients_Trigger, Enable in Find Mode

 

SearchClients_Trigger:

Set Error Capture [On]
Allow User Abort [Off]
IF Code (Get ( TriggerKeystroke ) = 13)
Perform Script [“SearchClients_Go”]
Else
Exit Script
End If

It fires the SearchClients_Go script:

Set Error Capture [On]
Allow User Abort [Off]
Perform Find []
If[Get(FoundCount) < 1]
Show Custom Dialog ["No records found"]
Go to Layout ["ClientSearch"]
Enter Find Mode []
ELSE
Go to Layout ["ClientList"]

If I select from one field and type a letter into another, it appears to trigger on any keystroke. So hopefully someone can see where I went wrong with this, or just tell me from your techniques how you go about handling only the press of the Enter button in Find Mode that fires a script that performs a script. 

 

Thanks for any help

Bumping this because I think I am having a similar problem but it seems like it would be a common issue and simple fix.

 

I have a data entry layout and a search layout. 

When you click the Search button on the data entry layout, it calls a script (SearchClients_Start) that performs these actions:

  1. Go to Search Layout

  2. Enter Find Mode

 

In the search layout (now in Find Mode), I have set each field to

Set Script Triggers

  OnObjectKeystroke

Perform Script SearchClients_Trigger, Enable in Find Mode

 

SearchClients_Trigger:

Set Error Capture [On]
Allow User Abort [Off]
IF Code (Get ( TriggerKeystroke ) = 13)
Perform Script [“SearchClients_Go”]
Else
Exit Script
End If

It fires the SearchClients_Go script:

Set Error Capture [On]
Allow User Abort [Off]
Perform Find []
If[Get(FoundCount) < 1]
Show Custom Dialog ["No records found"]
Go to Layout ["ClientSearch"]
Enter Find Mode []
ELSE
Go to Layout ["ClientList"]

If I select from one field and type a letter into another, it appears to trigger on any keystroke. So hopefully someone can see where I went wrong with this, or just tell me from your techniques how you go about handling only the press of the Enter button in Find Mode that fires a script that performs a script. 

 

Thanks for any help

Not sure if you still are looking for an answer on this, or perhaps it will help someone else that stumbles upon here in the future, but I too had the issue of it triggering with each keystroke. My issue was what appears to be yours (probably the initial post as well) which is a misplaced ")"

 

You have IF Code (Get ( TriggerKeystroke ) = 13) and it needs to be IF Code (Get ( TriggerKeystroke )) = 13.

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.