Prefilling a detail value with master value in master/detail scenario

Hi. I have a master/detail scenario. When I add a detail record I want to prefill a detail field with a value from one master field.

  1. I would like to do this in the Add “default value” of the detail field, but if I put in it MasterTable.MasterField.DbValue it fills with nothing.
  2. I could do this in detail table row_inserting event, but even there the code rsnew[“DetailField”]=MasterTable.MasterField.DbValue; doesn’t fill nothing.
    How can I do this? The project is in ANM2021, I cannot migrate it at the moment.

To get the value from a field the master table, try:
Resolve("MasterTable").MasterField.CurrentValue