Custom function in Zoho People

Custom function in Zoho People

Hi,

I'm trying to create a custom function that will copy all the approved record from "Leave" form into a custom form i created called "Sommaire absences".

I'm using this code and it's not working.  Can you help me ?
-----------------------------------------------------------------------------------------------

//iterate each record in Leave form

for each x in P_ApplyLeave

{
 //add to Sommaire des absences, using the Insert record task

insert into Sommaire_absences

[
Employee_ID = x.Employee_ID,
Added_User = zoho.loginuser

]

}