manusatsangi
23rd August 2002, 07:45
Hi,
I have a small problem. I am not able to get a function thru which I can automatically shift the cursor to a form field.
For e.g., if on pressing 'insert new record' button on a maintain form, I want the cursor to go to a certain form field violating the tab sequence of the form, I would write in the program script:
function before.choice.add.set()
{
// The cursor should automatically go to form field foo.bar
// How do I write it?
}
Warm Regards
Manu
morpheus
23rd August 2002, 08:04
Hello,
Use the sequence option in the Form editor, where you can specify the input sequence for the text boxes. Also, if you want to skip the input in some text box, depending on some data already punched in, then you can use IF condition in that field section.
Hope this helps.
manusatsangi
23rd August 2002, 08:30
Hi,
I have not tried these things because I was expecting some function :
move.cursor.to.field(<form field name>) or something like it.
Are you sure there is no direct function available?
Warm Regards
Manu
NPRao
23rd August 2002, 08:49
Hi Manu,
Please refer to -
http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_to_field
manusatsangi
23rd August 2002, 09:07
Hi NPRao,
That was almost the thing which I was looking at. But, it still does not solve my purpose as this can be written only in "after.input, after.display, after.field " subsections, but I require it when the user presses "Insert" Button.
Actually I am overriding a standard functionality of a script (session tfcmg2100s000) by using it's dll. In the standard functionality, as soon as the user presses "Insert new record" button, the cursor goes to the 4th input field (first 3 fields are taken from the parent session as default, this is a subsession). This is the default, even though the user can jump to the 2nd field.
Now I want that in the overriden functionality, when the user inserts a new record, he/she should by default go to the 2nd field.
Hope I have clarified my requirement.
Warm Regards
Manu
NPRao
23rd August 2002, 09:26
Hi Manu,
The possible option to do that is to make the 3 fields to be display fields or use the property, attr.input = false, so that the standard program transfers the control to the 4rd field in sequence.
you might also explore the functions, disable.fields() and inputfield.invisible().
But you might have to code these checks in the zoomed session, using prog.name$ predefined variable, or zoom.from section (zoom.from.<zoom name>:) and turning on the flag, then at each field if flag = 1 then put those functions.
manusatsangi
26th August 2002, 14:54
Hi NPRao,
Thanks lot for for your reply.
I am trying on similar lines. As a matter of fact, I require the reverse of what you said. When inserting a new record, the standard session automatically goes to the 4th field (even though the 2nd 3rd fields are editable), and I want the derived session to go to the 2nd field.
Moreover, I don't think disable.fields() works on Baan IV c4. I get compilation error. Am I right?
Regards
Manu
NPRao
26th August 2002, 19:44
Hi Manu,
Yes the enable/disable fields commands are BaaN-5 specific.
The equivalent functions in BaaN-4 might be attr.input = true/false.
I guess the 1st 3 keys might be index keys or reference fields or synchronized sessions, something... so that why the standard program might have passed the control to 4th field.
Sorry, I am not much aware of the finance sessions, I guess the other guys here might help you out.
Natasha
28th August 2002, 09:00
manusatsangi
You also can change the tab sequence of the form by session Maintain Forms -> Edit Form -> Modify Sequence and ID. But this tab sequence will be static (not only insert).