Custom Script doesn't fetch Data

Hello Everyone,

I have created some custom fields in the Employee form like UAN No, and PAN.

I want to fetch the data in these fields to the salary slip.

So I have created the same custom fields in the salary slip form and also have written the custom script to fetch data.

Below is the custom script to fetch data to the salary slip form from employee form (along with the above mentioned custom fields there are some other existing fields which I want to fetch).






When I create the salary slip from the employee form the above custom script works fine and fetches the data, but when I try to create salary slip from process payroll option the above script doesn’t work. It displays blank in the custom fields.

Can anyone help me with this?

Thanks & Regards,