Check user input "on fly"

NostaNosta Member Posts: 31
Hi all,

I need to check user input "on fly". I mean that I need to validate every keystroke, check if the last key and execute some actions depending on the pressed key value. I've tried to use the OnInputChange trigger of the textbox, but I cannot get the actual user input until he/she press Enter or leave the textbox.

Did anyone of you faced with similar issue and how did you cope with this?

br/Gennadii

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    I do not think that is possible with Navision.

    What functionality do you want to achieve? You are only describing the technical requirements.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    You really are going about this backwards. FIRST you define the business need, THEN you start programming. Sit with the client and determine exactly what they are trying to achieve, then analyze it in Navision terms and come up with a Navision solution.
    David Singleton
  • NostaNosta Member Posts: 31
    Mark, David,
    you are absolutely right, but this is not a request from a customer.
    It's just my researching in-depth of NAV objects' features :) I've been working with NAV for years and I always follow the rule you are talking about, but now I have a little time to play around with something "impossible". So, it's simply technical question, and nothing more.
    Sorry, if my post breaks forum rules.

    br/Gennadii
  • ara3nara3n Member Posts: 9,256
    There are several ways. You can use a COM object that displays a textbox.
    For RTC you can use Addins.
    There is a thread on mibuso that uses timer where you are changing quickly the control and thus leaving the text box.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Yes, in that case the add-in for the RTC is definately the way to go.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Nosta wrote:
    Mark, David,
    you are absolutely right, but this is not a request from a customer.
    It's just my researching in-depth of NAV objects' features :) I've been working with NAV for years and I always follow the rule you are talking about, but now I have a little time to play around with something "impossible". So, it's simply technical question, and nothing more.
    Sorry, if my post breaks forum rules.

    br/Gennadii

    No problem, but then you should mention it in your post. Other wise it looks like you are trying to solve a cusotmer issue the wrong way. :wink:
    David Singleton
  • NostaNosta Member Posts: 31
    I thought about using COM object, but... when you open Object Designer, make the ID column active and start typing any number, NAV searchs for the first object ID which satisfies whole entered number and highlight this record with focus rect. I suppose, this behaviour is designed on the NAV platform level, but I fiind this feature as "nice to have" on the user level. This is only the reason why I posted my question :)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Actually when I switched from DOS to Windows (Financials) one of the very first things I did was wrote the WinMine game in Navision. It was ridiculously slow, and basically unplayable, but I learn't a lot about what you can and can't do in forms, especially learning every trigger when it triggered and what it did.

    Unfortunately all the code got lost a long time ago. The only thing left is all the icons that I created. And of course all the knowledge that I still use today.
    David Singleton
  • NostaNosta Member Posts: 31
    I thought a bit where I can use this functionality and decided, that it would be nice to have a simple calculator in NAV with the same behaviour as it has in the Windows. About year ago, one of the accountants on the customer site asked me if it's possible to develop a simple calculator in NAV. I just gave her a CASIO from the next table.
Sign In or Register to comment.