[SOLVED] Open form from specific ID or from new state

Good morning,

I would like to display a specific recording (where id = [id_team] from the menu.

But I also want to open this form from a button above a grid (in new state)

I don’t know how to proceed, an idea ?

THANKS.

There is a sc macro for you open your form in mode as like you want.

Hello,

Yes I know, but it is not possible to open a form on a specific ID with macros?

Thanks

In your form you must set WHERE clause
image

Hello,

Thanks, that was my first option, but after that I don’t know how to open this form in insert mode from a grid.

Thanks

Put this on OnScriptInit of the grid
///
$check= [id_team] ;
if($check >=1)
{
sc_select_where(add) = " AND id = ‘$check’ ";
}

Hello Guys,

Thank you for you help, but if I add where clause in the FORM, I can’t insert new form after it.

I can force the form to start in insert mode, BUT after the insertion, I have always the query with the WHERE which is executed.

@nwdbs I don’t want filter my grid, but add a new button to create a new form.


I tried another solution from my menu with this code :

if ({sc_menu_item} == “item_72”):

??

endif;

Let me explain my problem with a diagram :

It’s better ?

Hi,

This is my solution in my menu :

if ({sc_menu_item} == “item_72”):
sc_redir(“team”,“id=[id_team]”);
endif;

1 Like