This topic is locked

BeforeAdd event code for the Copy page

2/13/2016 10:19:23 AM
PHPRunner General questions
L
laonian author

I have a table with fields as follows: A, B, C, D.

Fields A, B and C are included in the add page. D is not, but will be populated in the before record added event.
This is my code in the before record added page:

if ($values["A"]==1)

$values["D"]=$values['B']."-".$values['C'];


This is working fine with regular Add page. But when I use the Copy page to add the records, field D is not populated (when field A equals 1).
Any idea how to make this code work for Copy page, too? Thanks.