Master detail form - one update button to update both master and detail

Hello everybody - I am a newbie trying out SC and encountered an issue.Any help or pointers is higly appreciated.

I have created two applications. One master form (simple form) and another detail form (editable grid view).
I have insert,update & delete on master form and insert on detail form.When I enter detail values and click on update (on master form) detail values does not get inserted into the detail table.To insert detail values I had to click on arrow next to the detail values.

Instead of having multiple buttons to save the data, can I have one save button to insert data into both master and detail ?

Any help is highly appreciated.

Re: Master detail form - one update button to update both master and detail

Hi,
When you create Master / detail application, You have to note some of the tips as below

  1. In the master form you should enable “Return After Inserting” to Yes
    Master Form -> Toolbar -> Options -> “Return After Inserting”
    It means the Child record can only be inserted when the Master is inserted sucessfully
  2. The Child form should have a Foreign Key, which should be a Primary key in your Master Table(Form) has to Link field and other values (not null) should configured properly in the attribute values of the Details form

Refer the sample http://www.scriptcase.net/phpgenerator/samples/tutoriais/form/form56.php

Regards
Dhana

Re: Master detail form - one update button to update both master and detail

Dhana - Thank for your reply.I had both the points mentioned in your email covered.Here is the list of actions performed.

[1]Inserted Master Row.
[2]Form came back after inserting.
[3]Inserted child row.Inserted it into the database using the arrow next to the row in grid.
My question is , instead of inserting the child row using the arrow next to the row in the grid, is it possible to insert it using the update button on the master. Reason why I ask is , if there are 3 detail tables for one master , then there would be 3 insert buttons (one for each detail) and one update/save button for the master.
If all these (master and child data) could be saved to database with one save button , it would be neat.

Thank you for sharing your thoughts.

Regards

Pola

Re: Master detail form - one update button to update both master and detail

Pola,
Fine…!
Scriptcase deals every Detailed form as separate identity, because it gives more events open, to control the application.

May be you can use Editiable_grid in the Form where you may need to update every record one by one…!
We can post this as suggestion where Editable grid Batch update Option…!

Regards
Dhana

Re: Master detail form - one update button to update both master and detail

no chance of having a single button to save master and detail???

no chance of having a single button to save master and detail???

I don’t think so. I think it should be possible to have a toolbar above the master and a toolbar above the detail.

yes, this is exactly how it should be done. Each section for the Masted and Detail should have its own toolbar. We shouldbe able to manipulate CRUD buttons on the toolbar the way we want.
Also each record on the grid should have an ooption to Add/Remove 2 buttons (Insert/Delete)
At this point we have to use all kinds of tricks to get this functionality while this is asuch a basic feature that is should be implemented long time ago.

What I do for Master/Detail is

  • create a Edit Form
  • on the form create region
  • I place EditableGridView within that region (SC adds Insert/Edit buttons automatically - which bothers me in some casses because I have no easy control over those buttons)

the only problem I have now is when I add 3rd level detail (Grandchild record). I can’t find the way to edit it

Arthur

EDBQ_Parent_Child1_Child2.jpg

as a matter of fact I’m having lot of problems with the Toolbars showin buttons. Here and there they suddenly disapear. I think SC is very buggy here