no23rman Posted May 29, 2010 Posted May 29, 2010 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
Raybaudi Posted May 29, 2010 Posted May 29, 2010 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
no23rman Posted May 29, 2010 Author Posted May 29, 2010 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?
Raybaudi Posted May 29, 2010 Posted May 29, 2010 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 ?
bruceR Posted May 29, 2010 Posted May 29, 2010 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.
Raybaudi Posted May 30, 2010 Posted May 30, 2010 That would be on objectSave. How do you trap the "enter" key with that trigger ?
bruceR Posted May 30, 2010 Posted May 30, 2010 How do you trap the "enter" key with that trigger ? That's how commit works. That's the action that *causes* the save.
bruceR Posted May 30, 2010 Posted May 30, 2010 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.
no23rman Posted May 30, 2010 Author Posted May 30, 2010 i got it to work guys, thanks for all the help
kenneth2k8 Posted December 27, 2013 Posted December 27, 2013 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
TravisB Posted January 4, 2014 Posted January 4, 2014 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.
Recommended Posts
This topic is 4249 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 accountSign in
Already have an account? Sign in here.
Sign In Now