AnsweredAssumed Answered

Preventing enter character after search

Question asked by ndveitch on Aug 22, 2018
Latest reply on Aug 22, 2018 by ndveitch

Hi there,


I am trying to get a quick find option going for my client but I can't seem to stop the carriage/enter character from being added to the search field after the search has been run.


I have a global field on the layout, z_Globals::f_SearchName, and then onObjectKeystroke, I have a script that runs,


# If the user hits enter, run a perform find on the data in the search field


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

  Set Variable [ $search ; Value: z_Globals::f_SearchName ]

  Perform Quick Find [ $search ]

  Commit Records/Requests [ Skip data entry validation ; With dialog: Off ]

  Go to Field [ z_Globals::f_SearchName ]

  Set Field [ z_Globals::f_SearchName ; $search ]

  Go to Record/Request/Page [ First ]

  Scroll Window [ Home ]

End If




Exit Script [ Text Result:    ]


At first the script was only

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

  Perform Quick Find [ z_Globals::f_SearchName ]

End If


But I found that after the search was run and the script finished, it went and put the enter character in so the search field would open up, as if the enter that triggered the script was still in memory, and only after the script finished did it complete the enter character that the user pressed to start the search. I have tried refresh window and commit records but none of them seem to work. What am I doing wrong?????