How to update detail table automatically when inputting data in master detail?

Is it possible to update the detail table automatically when inputting data in the master detail?I have a master table with an x_cardnumber column then in the details there is also an x_cardnumber column with multiple records.How do I do this when I input data in the x_cardnumber master table. the x_cardnumber in the detail table is also updated automatically

Your case is a bit confusing. When you said inputting data in master table, then it means there are no data yet both for your master and detail table. How can you update the data in detail table, then?

Because i already have master table which is summary from detail table, but in the detail table there is blank field that must multiple update by field in master tableMaster table:
Name, address, sumofbuy, id_cardDetail table:
Name, address, buy, id_cardWhich is master table already summaries by name and by addressI need to fill id card (multiple) in detail table automaticly just by input id_card in master table

use Server Event table specific row inserted like this:

$myResult = ExecuteStatement("UPDATE MyTable SET Field1=Value1, Field2=Value2, Field3=Value3 WHERE MyField=XXX");// Row Inserted event

and if you want to input multi values use concat function

diazwahynugraha wrote:

I need to fill id card (multiple) in detail table automaticly just by input id_card in master table

Then you should use Row_Updated (not Row_Inserted) server event that belongs to your master table in order to update the related data in your detail table.

// Row_Updated event for MasterTable
function Row_Updated(&$rsold, &$rsnew) {
    // Check if id_card field is updated
    if ($rsold['id_card'] != $rsnew['id_card']) {
        // Perform update in DetailTable based on the updated id_card value
        $detailUpdateQuery = "UPDATE DetailTable SET id_card= '{$rsnew['id_card']}' WHERE name= '{$rsnew['name]}' AND address= '{$rsnew['address]}' ";
        Execute($detailUpdateQuery);
    }
}

this error

Refer Documentation : Field Setup ->Client Side Event ->Example 1 & Example 2IN MASTER TABLE FIELD : x_cardnumber (Client Side Event)

{
    "change keyup": function(e) {
		$('[data-table=DETAILTABLE][data-field=x_cardnumber]').trigger("change");
    }
}

IN DETAIL TABLE : x_cardnumber (Client Side Event)

{ // keys = event types, values = handler functions
    "change keyup": function(e) {
		var xcardnumber = myform.elements["x_cardnumber"].value;
        var $row = $(this).fields(); // Get an object of all fields, each property is a jQuery object of the input element(s) of a field
        //var st = $row["UnitPrice"].toNumber() * $row["Quantity"].toNumber() * (1 - $row["Discount"].toNumber()); // Convert to number and calculate
        $row["x_cardnumber"].value(xcardnumber); // Set result to a field
    }
}

Think this will help

There is no need to add curly brackets in your SQL, so try this:“UPDATE DetailTable SET id_card='”.$rsnew[‘id_card’].“’ WHERE name='”.$rsnew[‘name]."’ AND address=‘“.$rsnew['address].”’“It that SQL doesn’t work, then you need to re-evaluate your data while updating master record, especially for name and address fields, whether it will be changed or not… if those fields remain same, then you may try:“UPDATE DetailTable SET id_card='”.$rsnew[‘id_card’].”’ WHERE name=‘“.$rsold['name].”’ AND address=‘“.$rsold['address].”’"

Fatal error: Call to undefined function Execute() in …i dont know why

Try to use ExecuteStatement instead of Execute.