update primarykey master table on imported detail table

HiI have master table : idm (Primarykey), date, group
detail table : id(Primarykey), idm (foreignkey), name, bitrhdaywhen i try to import detail table in master/detail, idm (foreignkey) only show 0
how to make idm include in detail table?
i try to put on server event row inserted like this

$idu= $This->idm->CurrentValue();
ExecuteUpdate(“UPDATE master SET idm = $idu”);but show error 200 OKHow to solve this problem? I am using PHPMaker 2022.11TIA

i try to put on row inserting$rsnew[“idm”] = $GLOBALS[“master”]->idm->CurrentValue;Still error 200 OKIn my assumsion if there is master/detail the field idm automatically fill with idm from master table but in my case only show 0 valueAny Hint?
TIA

Try:$idu = Container(“master”)->idm->CurrentValue;Make sure master is your master table name; if not, adjust it to yours.

still not working, i use this script on row inserted$rsn = Container(“master”)->idm->CurrentValue;
ExecuteUpdate(“UPDATE detail SET idm= ‘$rsn’”);field idm on detail table field value is 0

any hint?Thank You

There is no data in the master table object at all (even you create the instance) when you import records into the detail table.There is no master/detail import, you need to insert/update the master table yourself (you need to provide values for the “date” and “group” field of the master table).