Function "activate" on Controls selects wrong control

StLiStLi Member Posts: 83
Hi,

I Build a Form, supposed to be used on a terminal with a touchscreen display and a a barcode scanner. The scanner automaticly adds an enter at the end of the scanned text and I want to manage the next selected Control manually.

However after the execution there is always the next control active right after the one my code decided to select. (yes, i checked the properties - I'm using the correct control Names)

I guess this is because Navision somehow selects the next control AFTER the code is executed so the Enter/Tab sends the focus to the next one. But i have no idea how to prevent that.

My code currently runs in the "OnValidate"-Trigger but i also tested the "OnAfterValidate" - same result. "OnDeactivate" ends up in a deadloop... I ran out of ideas.. I don't wanna change everything up to predict that behavior because it's not the "right" way and because it will be confusing once the code will be analyised for modifications in the future.

Thanks in advance!
StLi

Comments

  • MBergerMBerger Member Posts: 413
    I have had the same problem, and the only solution i have found so far is a workaround : Add a dummy control to your form, set the taborder so that the control AFTER it is the one you want activated, then ACTIVATE the dummy one.
Sign In or Register to comment.