May 29, 201015 yr 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
May 29, 201015 yr 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
May 29, 201015 yr 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?
May 29, 201015 yr 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 ?
May 29, 201015 yr 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.
May 30, 201015 yr How do you trap the "enter" key with that trigger ? That's how commit works. That's the action that *causes* the save.
May 30, 201015 yr 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.
December 27, 201312 yr 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
January 4, 201411 yr 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