I'm trying to write a dynamic duplication script that will create a new record and insert the foreign key value of the original field. I originally used the 'duplicate record' script step but it became apparent that waht I needed was a duplicate without the data from the original. Since there are many layouts and tables I would like to write this in a modular fashion so I don't have to use script parameters and a huge script that checks for each one.
Basically, I'm trying to set the $data variable with the field $id. but in $data all i'm getting is the value of $id and not the value of the field with the name $id.