OK, I learned to use “sc_apl_conf(“my_form”, “start”, “new”);” code to open a form in record insert mode.
But I want the code to run only when I open the form from the “New Employee” menu item.
Because I’m using the same form in normal grid view with another menu item: “Employees”
So, I need to check if “New Employee” menu item is selected by user.
I tried to use following code in onApplicationInit event of “Employees” form :
if ({sc_menu_item} == "item_18")
{
sc_apl_conf("Employees", "start", "new");
}
But when I click the menu item, the form opens in normal grid view and I get the following error:
“Undefined variable: sc_menu_item”
What am I doing wrong?