Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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

Posted

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?

Posted

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 ?

Posted

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.

Posted

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

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

Posted

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.

Posted

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

  • 3 years later...
Posted

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

Posted

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.

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