tools123
18th March 2003, 00:18
I have a maintain session with form type 2.
Number of occurences on the form is currently set to 11.
I have 4 fields from the table displayed for maintenance.

What are the options to:
1. Skip the next field and move to the next record when 'enter' key is pressed after this field
2. To skip to the next record after the last occurence on the
form when reaching end of occurances(11).
I think in.ret may solve half of my problem
This is on c4.
fields are in this format:

(field1) (field2) field3 field4

Fields 1 and 2 are display fields. I need to be able to get to
field 3 of next record right after'enter' after the field 3 of
previous record.

Thanks

NPRao
18th March 2003, 00:30
You can use the tools function - to.field() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_to_field)

Also, refer to the thread - How can i change the Tab flowing order from a form ? (http://www.baanboard.com/baanboard/showthread.php?s=&postid=34961#post34961)

tools123
18th March 2003, 01:52
I have not tried out your suggestions yet.But, I think the main
thing I want to do is pass control when the user presses the
"enter" key.How do I capture this event?in.ret?

The user should still be able to go to field 4 in case the key stroke is not a enter,but a tab.

NPRao
18th March 2003, 02:15
Please fill up your profile with BaaN/OS/Database info.

I am assuming you are working in the BaaN-4 series.

You have to use the predefined variable - in.ret (http://www.baanboard.com/programmers_manual_baanerp_help_misc_predefined_variables)

long in.ret 4R
Integer value of key pressed on input field. Cursor keys and zoom keys cannot be detected. Valid only in on.input, after.input, and after.field sections.


so you have to program it in your script to capture the return values (ascii value of the key) and compare -

if in.ret = 27 then
...
endif

I am on the latest BaaN-5.2 I did not find any examples maybe the other guys on the Board who are on the BaaN-4 might post an example code for you.

tools123
18th March 2003, 02:24
Hi NPR,

I wanted to confirm if "in.ret" was in fact the best option to
capture the event.I have already seen a couple of examples
threads and was curious if there was different approach.

My posting at the beginning of the thread has my Baan version
4c4.I will update my profile anyway.


Thanks

tools123
18th March 2003, 16:42
I tried the in.ret but it does not return any value for 'enter' key.
Any ideas?Any body coded for 'enter' earlier?

Please note I am getting values for tab and arrow up and down keystrokes. so, there is nothing wrong with the in.ret usage.

Thanks

mark_h
20th March 2003, 04:27
I tried it once before with the same results you have. I could trap certain keys, but not the enter key. I figured the something in the 4gl coding or the client was preventing it from making it to the code. Hopefully someone else has the answer or if you figured it out, please post the answer.

Thanks

Mark

tools123
20th March 2003, 13:23
Mark,
I have not figured it out yet.
Hope somebody has tried it out b4.

lbencic
20th March 2003, 18:39
I'll stick out what may be a silly idea, since you don't seem to be able to trap that 'enter' key, you can default a button, like 'continue' to activate when the enter key is pushed. You could then program some things in the choice.cont.process section...not sure if you would be able to achieve all of your field control stuff there, it would be messy, but probably you could get close.

tools123
20th March 2003, 19:45
==========================
Quote:
since you don't seem to be able to trap that 'enter' key, you can default a button, like 'continue' to activate when the enter key is pushed.
============================
I may not have understood you right,but how can you default
to anything when you have not yet known the ENTER key is pressed?I mean Reading the keystroke is primary here.

lbencic
20th March 2003, 19:53
When they hit the enter key, the default button is activated. Set the default button to 'continue' in Maintain Forms / Buttons button, and the continue (thus choice.cont.process section) will be executed when they hit enter.

tools123
20th March 2003, 19:59
I think I have already tried that and need to revisit that option.
If I remeber right,my problem with such an approach is the
control will be transferred to that button and I need to get back the control onto my record each time.Please review my first post
in this thread about the flow.

Thanks

lbencic
20th March 2003, 20:04
O I read - that's why I'm saying it could get messy. But you have a spot if you want to try.
You can get them back into the fields by playing with the execute(....) functions - execute(add.set) would put them back in add mode, execute(modify.set) would put them back in modify. You could use the occurance variables to know what occurance you were on...In the add and modify set options you may be able to do more field control... I agree, may not be the best place for field control.

lbencic
20th March 2003, 20:05
Also, I think this is why you are not getting the return of the enter key for in.ret. Baan already takes that and keys button logic off of it, so it is probably reset by them so you can't use...?

NPRao
19th April 2003, 00:04
Yes, you can trap the ENTER/RETURN keys using event handlers.

Refer to - Events sample program (http://www.baanboard.com/programmers_manual_baanerp_help_events_sample_program)

tools123
21st April 2003, 02:51
NPR,
Thanks for the solution.Will try it out this week.

günther
15th December 2004, 11:37
Currenty I'm also playing with keyboard events. Have you already found a solution?

Günther

BaaNovva
8th February 2013, 13:39
Like in.ret in BaanIV, I am looking for an equivalent in BaanV or InforLN. 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 the field. How can I achieve this ? I tried event handlers but next.event() or peer.event() are waiting for input. I don't want to trigger an event. I just wanted to capture the key stroke for a normal Tab field event that just happened. Is this possible with the DFE of Infor ERPLN ?

Hitesh Shah
23rd February 2013, 07:54
The keys which trigger events in BW are not trappable . It's well documented . So u may not not be able to trap TAB , UP/DOWN arrow etc . Others like CTRL+A etc can be trapped with in.ret or g.in.ret variables .