This topic is locked
[SOLVED]

 Master/Detail Importing

7/9/2014 4:26:02 PM
PHPRunner General questions
S
safesurf author

I am using PHPRunner 7.1 and I have a Master/Detail page, I have the Import function enabled for the detail page and would like to use it to import data to the detail table so that the records will be assigned to the master table record, but currently this imports only to detail table when foreign key field is enabled in detail table.

Currently this all works as it should except for the import function.

I understand that this will require capturing the master key in some way to populate the detail key field when the import happens.

Has anyone done this, if so could you give me some sample code on how to do this please?

S
safesurf author 7/11/2014

I got it working by putting the code below in the Import page Before Insert Record event.
$data = $pageObject->getMasterRecord();

$values["FieldNameFK"]= $data["FieldNamePK"] ;