Print Shipping Label with Advanced Standard Template Gives Unexpected Error

Written by
Milkie Fernandez
Published on
May 31st, 2023

Scenario

Print Shipping Label from Item Fulfillment using Standard Shipping Label PDF/HTML Template gives an error:"An unexpected error has occurred. Please click here to notify support and provide your contact information.".

In the Standard Shipping Label PDF/HTML Template, the following code condition on line 47 <#if label.refNumber !=0> expects to evaluate number from the PO # field (id:otherrefnum) on Sales Order.A non-number value on the PO # field displays this unexpected error. Change the condition in order to print Shipping Label with non-number value on the PO # field.

Solution

  1. Navigate toCustomization>Forms>Advanced PDF/HTML Templates
  2. Standard Shipping Label PDF/HTML Template:ClickCustomize
  3. Top Right Corner:ToggleSource Code
  4. Line 47:Find<#if label.refNumber !=0>
  5. Replace it by<#if label.refNumber?has_content>
  6. ClickSave

Note:Make sure that the new custom template is marked Preferred.