BaaNovva
8th February 2013, 12:46
Like in.ret in BaanIV, I am looking for an equivalent in BaanV or InforERPLN. On a DFE form when the user tabs from one field to another using keyboard I wanted to trap this TAB keystroke in after.input of a field. How can I achieve this ? I tried event handlers but next.event() or peer.event() are waiting for input when used in after.field. I don't want to trigger an event. I just wanted to capture the "TAB" key stroke that just occured when user jumps from field to field using TAB key from keyboard. Is this possible with the DFE of Infor ERPLN FP7 ?

bhushanchanda
10th February 2013, 05:11
before.checks:
For non-enum fields the actions programmed in this subsection are executed when the field looses focus. I.e.: the TAB key has been pressed or the user clicked on another field. The subsection is executed immediately before the domain and references are checked. You can use this section, for example, to change the value of the field before the domain and reference checks.

For enum fields (type DB.ENUM or DB.BITSET) the actions programmed in this subsection are executed in two cases:

when the user changes the value of the field; in this case the subsection is executed just before the when.field.changes subsection
when the field looses focus, but only in case the field's value was not changed


OR

check.input:
This section is replaced by Data Access Layer functionality (if a DAL exists for the table).

The actions programmed in this subsection are executed immediately after the domain and reference checks. You can use this section to test for errors that are not detected automatically. If the 4GL engine detects an error, the focus remains on the field. In a script, you can use set.input.error() to display an error message and start input again.

on.input:
This section is supported for backward compatibility. Functionality has been replaced by Form Commands.

The actions programmed in this subsection are executed immediately after the check.input subsection. You can use this section, for example, to perform some appropriate action when the user enters a special character or to display a warning message in certain cases.

You can do this in any of the above two ways:

e.g

field.fieldname:

before.checks:

condition . . .

if condition not met

input.again() | This will force user to enter the value again

BaaNovva
13th February 2013, 09:06
Hello Bushan,

Thank you for responding but I am sorry, your answer is way off my question. What I wanted is how to capture Tab key stroke when user jumps from field to field.

I am not looking for any event. I am looking for a function or predefined variable to capture keystrokes.

Some thing like


before.checks:
if keyin$(99) = <ASCII value of TAB keystroke> then
<do something>
endif


But keyin$() is depreciated and cannot work in BaanERP or Infor ERPLN (BaanVI).

If anyone can replace the code in red above with a working code, this hunt can be ended. Looking forward for answers. Until then, thank you for the replies in advance.

mark_h
13th February 2013, 15:24
I can't imgine why you only want to trap tab and not a click, but have you looked at using these events (http://www.baanboard.com/programmers_manual_baanerp_help_events_sample_program). You can search on keyin$ and find other threads on what people did - like this one by steveauckly (http://www.baanboard.com/baanboard/showthread.php?t=60280&highlight=keyin%24). There are other threads and I pulled this from one of the responses by NPR.

BaaNovva
20th February 2013, 09:27
Thanks Mark for your reply.

In some specific situation user needed to follow a particular pattern of entry among a group of fields and this is against std tabbing sequence. This is done by enforcing focususing to.field which can be suitable in such situations. But when saved the to.field also fires due to refresh and focus automatically jumps to next field. To prevent this I wanted to change focus only when tab is pressed.
I tried events and keyin$ but none work.

mark_h
20th February 2013, 15:37
Can't you track which field they were on when they hit save? For example what I am thinking is you set up a variable that as they enter each field it gets set. Then when they hit save(or really any other event) you could direct them back to that field with to.field(). Of course I never really tried a whole lot of stuff with to field.

The only session I have that they have to enter the fields in order for the validation to work I just put out error messages and left them on the field. For example - I can't validate the peg build item unless you enter the project first. If they clicked on build item and entered it - it would just keep giving them an error until they went and entered the project first. They learned quick to input them in order.