If you have created Master/Detail relationships based on Parent Key Foreign Key relationships you can use AutoFill to automatically transfer required values from the Master Table to the detail table. Generally this occurs by default for a single record transferring of an Integer from the Master Table to the Detail Table so a link can be established. Before doing this ensure you have valid referential relationships established in your database.
In this example there is an AutoFill value which is a GUID, which is the second unique Primary Key for the Master Table. The Row Rendered event can be used to prefill this value into the details table. The following code as provided by ASP Support; The two Unique ID's are SiteID and GUID.
If <SiteIDField>.SessionValue <> "" Then ' Detail add
<GUIDField>.EditValue = ew_ExecuteScalar("SELECT <GUIDField> FROM <MasterTable> WHERE <SiteIDField> = " & <SiteIDField>.SessionValue)