ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Custom Script doesn't fetch Data


#1

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).

cur_frm.add_fetch(‘employee’,‘date_of_joining’,‘date_of_joining’)

cur_frm.add_fetch(‘employee’,‘company_email’,‘company_email’)

cur_frm.add_fetch(‘employee’,‘uan_no’,‘uan_no’)

cur_frm.add_fetch(‘employee’,‘pan’,‘pan’)

cur_frm.add_fetch(‘employee’,‘employee_number’,‘employee_number’)

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,

Sujay