Insert new record in form Master/detail when master is saved.

Hi, In form Master/Detail. How can i insert a new record in form detail when the master is saved? (The idea is not click on Button Add New. for first record)

Any Idea about that?
I think SC must implement a function for forms type Master-Detail. When a new record in form Master is saved, Insert automaticaly in detail, a new record.

It might seem obvious but… sc_exec_sql on AfterInsert event?

add an insert sql statement in the master onAfterInsert event

$sql = "INSERT INTO detail_table_name ...";
sc_exec_sql($sql);

I need to insert a New record in the form detail. No in database. (A way click the button New. Possiblelly with javascript).

Not sure, but are you describing an issue similar to this one:

http://www.scriptcase.net/forum/forum/main-category/main-forum/74551-how-to-get-add-new-button-on-empty-detail-grid

that I mentioned awhile back?

That is not my question. If the master is saved (When insert a new record). I Need that Detail add a Line in Blank, so the user does not Need Click the Button New Record of Detail.

OK. That’s actually the behaviour I was expecting and wanted. I got distracted when we couldn’t add a new detail record at all. Maybe in version 10?

I Think that is possible do it. It’s add a new line in blank in form detail (In memory).
I Hope in New versionsof SC, This functionality be implemented.

i found this quite useful if SC can implement when press add new, the master and detail already inserted,

anyone already found solution for this ?

maybe calling the JS function linked to the add new button of the detail in the onafterinsert event of the master