Master/detail as form/grid

Hi,

I searched across the forum, but only found questions, no answers.
I prefer maintain the data in a grid/form style: grid for browse, form to enter data. Now I have to make master/detail relation (like invoice)
So I have 4 application: grid_master, form_master, grid_detail, grid_detail. The form_master and the grid_detail should be in one application, as a master/detail. It works as a standalone one, but putting together there?s no buttons to insert and edit, neither my defined buttons.
Is the SC master/detail only works as an editable grid? Can it work as I need?

Thanks

Re: Master/detail as form/grid

Hello norby,

Detail application buttons are disabled by default.

regards,
Bernhard Bernsmann

Re: Master/detail as form/grid

Thanks.
Is there any way to enable them? onScriptInit doesn’t work.

Re: Master/detail as form/grid

Unfortunately not,

The detail application was designed this way. What you can do is send us a suggestion to enable those buttons at suggestion@scriptcase.net

regards,
Bernhard Bernsmann

Re: Master/detail as form/grid

Thanks, I’ll do.

I made a workaround by now, using editable grid, new text field for the lookup value, hiding the real field, and using capture link. The returned id turned into the visible description by some php code, and ajax.

Re: Master/detail as form/grid

I managed to make a workaround, using a form_master calling a grid_detail with parameter passing using global variables using Maste/Detail Form, and then edit the records in the grid_detail using sc_link() function on a selected field to redirect to a single record form application.

Re: Master/detail as form/grid

Sorry for not replying, here’s my workaround:

So the detail application must be editable grid form. I have an ID field in the detail table, but I wanted to show only the description from another table. It can be done with select field type, but I wanted to without combobox. Here?s my solution:

I created a new field on the detail, let?s call it DESC. I made the ID field hidden, and created a capture link on the DESC field to the grid application (displaying the table containing the ID and it?s description) returning the ID.
We need script on the OnLoad event:

sc_lookup(rs,“select desc from another_table where id=’”.{ID}."’");

if (isset({rs[0][0]}))

{

{DESC} = {rs[0][0]};

}

else

{

{DESC} = ‘’;

}

And an AJAX event on the DESC field OnChange:
sc_lookup(rs,“select desc from another_table where id=’”.{DESC}."’");
if (isset({rs[0][0]}))
{
{ID} = {DESC};
{DESC} = {rs[0][0]};
}
else
{
{DESC} = ??;
{ID} = 0;
}

It it isn?t clear enough, just ask.

Re: Master/detail as form/grid

My solution the detail uses a Grid application and not a Form application with editable Grid.

To edit the records in the detail, I uses the sc_link function on a field in the detail to call a form application (single record) for editing.

To add new records in the detail, I created a button at the master level, selecting “PHP”, I added the following commands:

sc_apl_conf(“my_form”, “start”, “new”);
sc_redir(my_form.php, parm1=[global variable], “_blank”);

I realised that when I select “LINK” when create a button, it does not seem to work.