Focus on field after auto-insert

Hi

Searching for a solution to insert a record in grid in automatic mode after change focus on a single field ( in this case the field name is “barcode” ), i’ve found this javascript than run very well

[INDENT]function sc_barcode_onchange()
{
var n = F1.elements[“sc_contr_vert”].value;
n = (n - 1);
findPos(this);
nm_atualiza_line(‘incluir’, n);
document.F1.barcode.focus();
}

[/INDENT]

but now my problem is: how to put the focus on the first field of a grid after insert done in the way described before? I tried this but does not work

[INDENT]function sc_form_onload()
{
document.F1.barcode.focus();
}

[/INDENT]

Someone has already dealt with a similar problem? The environment is SC 7.0.009

Giorgio

There’s an option to set the first-field focus in the menu’s somewhere. Did you try that too? I assume you mean editable grid view?

Already tried but does not work. The focus is lost somewhere.
I confirm editable grid view.

Giorgio

No one who has any ideas on how to resolve this situation?

Hello,

Have you tried to set focus using our macro?

sc_set_focus: http://downloads.scriptcase.com.br/downloads/v7/manual/en_us/webhelp/manual_mp/28-Macros/00-macros_sc.htm#sc_set_focus

regards,
Bernhard Bernsmann

I tried with a form master - detail, and i need when click button insert new on detail, that focus on one field and do not works.
i tried both opcins in SC.

  1. in settings: Field with initial focus listbox
  2. sc_set_focus(‘field_name’);

Any idea?

Solved!!!

Follow this Thread

Thanks to all for suggestions.