New Custom Field added to the Standard Print format not showing on PDF

Hi,

I have added a few custom fields for calculating “leave balance” and “leave taken this month”, to the Salary Slip table. The fields are getting calculated and are showing in the form. Now, I added these fields to the standard print format. Though, these are showing up on the screen, when i click on the print icon, but the fields do not get reflected in the PDF or in the Print Preview. What could be missing out?

Thanks
Uma

Hello Uma,

Is this a standard print format, or made one in the HTML print format?

Hi @umair,

This is standard print format.

Since this issue is related to customization, request you to share following info.

  1. Custom Script.
  2. Screenshot of the custom fields indicatinf value in the Print Hide.

Hi Umair,

Attached is my custom script and the screenshot of custom field with Print Hide value.

frappe.ui.form.on(“Salary Slip”, “after_save”, function(frm, cdt, cdn) {

      frappe.call({
            method: "icp.api.get_leave_balance_on",
            args: {
               "employee": frm.doc.employee,
       "leave_type": "Casual Leave",
       "date": frm.doc.end_date
       
           },
               callback:function(r){
                       
                       if(r.message) {
             
                         frappe.model.set_value(cdt, cdn, "casual_leave_balance", flt(r.message));
             refresh_field("casual_leave_balance");
            }
                     }
         });


      frappe.call({
            method: "icp.api.get_leave_balance_on",
            args: {
               "employee": frm.doc.employee,
       "leave_type": "Privilege Leave",
       "date": frm.doc.end_date
       
           },
               callback:function(r){
                       
                       if(r.message) {
                                        
                         frappe.model.set_value(cdt, cdn, "earned_leave_balance", flt(r.message));
             refresh_field("earned_leave_balance");
            }
                     }
         });

});

The Print Hide is not set for any of the custom fields.

Hi @umair,

Any idea why I am still not able to view them in PDF or Print?

Regards
Uma

HI, any solution for this issue ?I faced same issue

Hi @harrisonle,

I was not able to resolve this issue. So, had to write a separate print format for this.

How to create separated print format with these customs field ? So headache !

Here is the help on creating Custom Print Format using Print Format builder.

Feel free to Google for help as a prevention from headache :wink: