Forcing a new record in a form

This ought to be easy, but I am finding myself going through a convoluted coding process to do it. I’m sure someone here has an easy way:

I need to open a form application using a button. I am currently using the sc_redir() macro. I am passing a number of parameters to the form being opened.

But I need to form to open with a new record (insert mode).

T.I.A.

Re: Forcing a new record in a form

GuiGuy ,
Refer sc_apl_conf for different options…

For new record, you can achive like this…
sc_apl_conf(“my_form”, “start”, “new”);

Regards
Dhana

Re: Forcing a new record in a form

Thanks Dhana. I figured there was an easier way…

Cheers

Re: Forcing a new record in a form

Hi,
That doesn’t work for me. The form always starts in edit (modify) mode with the first record selected.
Code I am using follows the help file example

Ex1: Forces the “my_form” application to start in the inclusion mode.
sc_apl_conf(“my_form”, “start”, “new”);

which is

sc_apl_conf(“form_tblinforequest”, “start”, “new”);

where “form_tblinforequest” is a valid application within the project.

NB: What does the help file mean when it refers to “inclusion” in forms, as in "start new Forces the form to start in the inclusion mode of new register. ". Is it a translation error?

Re: Forcing a new record in a form

GuiGuy,
You have to do some changes in the Toolbar.
When you want in Insert mode, remove Update button from the Form & try
Regards
Dhana

Re: Forcing a new record in a form

Thanks once more; that worked.

Re: Forcing a new record in a form

GuiGuy,
fine,
refer this below post… related to this topic

http://www.scriptcase.net/forum_en_us/index.php?topic=1302.0

Regards
Dhana

Re: Forcing a new record in a form

Hi,

It works, simply change the name form_tbinforequest for the name of the form that you?re using to the form forced to inclusion.

Thanks,

Eduardo Cazaress

Re: Forcing a new record in a form

When you want to launch an application and go to insert mode automatically, you can do this using a parameter. In the example below, the application has a parameter ID.

…form_test.php -> form launches and opens first record
…form_test.php?ID=198 (198 is existing ID)-> form launches and opens record with ID 198
…form_test.php?ID=-999 (-999 is a NON existing ID)-> form launches in insert mode. Auto increment is used to populate ID, so -999 is not actually used. Also make sure you use a value that will never exist in the future. Works great in my applications.