Keyboard character

ramyavenkatramyavenkat Member Posts: 94
Hello All,

I want to capture the keyboard "enter" and "tab" key on input in any field. Is there any function like getchr() to capture the key typed in by the user?

thanks & regards,
Ramya Venkat

Comments

  • sggsgg Member Posts: 109
    Hello All,

    I want to capture the keyboard "enter" and "tab" key on input in any field. Is there any function like getchr() to capture the key typed in by the user?

    thanks & regards,
    Ramya Venkat


    When a user Press Enter or Tab key in a field on a Form, The Cursor moves to the next control.

    If what you want to Capture is when the value in the field is entered/modified then put your codes in OnValidate() Trigger of Control

    If it is AFTER the value in the field is entered/modified and Validated, then put your codes in OnAfterValidate() Trigger of Control

    But if it is whenever then cursor Leaves the field after the cursor had being in the field (Whether data is updated/modified or Not), then put your codes in OnDeactivate() Trigger of the Control

    Read CSIDE Reference Guide about these triggers. You will know where you can write to the database and where you cannot.
    Sunday, Godwin G
  • aleix1979aleix1979 Member Posts: 213
    What I think ramyavenkat wants to do is an C-like reading of characters one by one. I am afraid you should forget about these close-programming tips but you can do something with functions like COPYSTR and so on.
    Navision Developer
  • ramyavenkatramyavenkat Member Posts: 94
    Hi,
    Actually, i want to scan a barcode with item and lot number in the item field in navision screen. I use the keyboard wedge type barcode reader for this. when the reader reads it, i will have my cursor in the item field. the data that would come in would have a combination of item no, sno and lot no. i need to split all the three and only the item no needs to fall in the item no. field. on pressing the enter key, i want the tab to directly jump to the qty field. can u suggest a solution for this....

    thanks
    regards,
    ramya venkat
  • kinekine Member Posts: 12,562
    For jump to next field (other than nearest) use "NextControl" property on the first field (on "Item no." set NextControl to ID of Quantity control)

    To split code, add code into OnValidate on the field.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • sggsgg Member Posts: 109
    Hi,
    Actually, i want to scan a barcode with item and lot number in the item field in navision screen. I use the keyboard wedge type barcode reader for this. when the reader reads it, i will have my cursor in the item field. the data that would come in would have a combination of item no, sno and lot no. i need to split all the three and only the item no needs to fall in the item no. field. on pressing the enter key, i want the tab to directly jump to the qty field. can u suggest a solution for this....

    thanks
    regards,
    ramya venkat

    if what you want to do is to split the barcode into its 3 components,
    you could add a new textbox for a Variable (Code 40 = 20+10+10) into which you will read the barcode. Then Inside the OnValidateTrigger, use COPYSTR to split the Barcode Read into its 3 components. You then Validate the 3 Fields with their respective Values from the components.

    This is better than reading into the Item No. Field since the Barcode Read may be more than the Field Length of Item No. (20)
    Sunday, Godwin G
Sign In or Register to comment.