This topic is locked

CopyOnLoad - Original ID in Duplicate Record

12/24/2017 12:55:55 PM
PHPRunner General questions
G
gdmacdo author

I would like to use the copy button on a list to duplicate the records but have the original value in theID field to populate in the copied records parent_event field.
I'm sure this is a noob question.
I have tried these and many other options (each one is a separate attempt):
$values['parent_event']=$keys["ID"];

$values['parent_event']=$keys["copyid1"];

$values['parent_event']=$values['parent_event'];
Can anyone help?

Sergey Kornilov admin 12/24/2017

The following should work:

$values['parent_event']=$values['ID'];


You need to start by checking documentation:

https://xlinesoft.com/phprunner/docs/onload.htm
You can see that there is no $keys parameter in this event meaning that you cannot use $keys in your code.

G
gdmacdo author 12/25/2017



The following should work:

$values['parent_event']=$values['ID'];


You need to start by checking documentation:

https://xlinesoft.co...docs/onload.htm
You can see that there is no $keys parameter in this event meaning that you cannot use $keys in your code.


Thank you. That was one of the many things I tried. I attached a video demonstrating the copy process and the code if it helps. I even removed my "before display" code after the video (it hides some fields if not a certain user) and it did not work either.
Google_Drive_MP4_Video

jadachDevClub member 12/25/2017

When you copy a record, you are creating a new record with a new ID. You don't have access to the ID field you are looking for.
You would need to duplicate the ID field (when adding records) in another field that you can use with your copy page.