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).
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”);
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?
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.