web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Send ZPL code to Zebra printer

(1) ShareShare
ReportReport
Posted on by 8
Hi all,
 
I am using D365F&O.
I have written a code to send information to UPS API and create a shipment and generate label.
The label generated from UPS is in form of ZPL code.
How can I use this ZPL code to print label using X++, without creating an ssrs design ?
Is there anyway I can send this ZPL code directly to a ZPL printer registered in Network printers in D365F&O ?
 
Thank you for your suggestions and answers in advance
 
I have the same question (0)
  • Suggested answer
    Jonas "Jones" Melgaard Profile Picture
    4,894 Super User 2025 Season 2 on at
    Send ZPL code to Zebra printer
    Hi!
      

    This one is super easy, F&O has a really great method for this that I have used a couple of times.

    Look at WhsDocumentRouting, and specifically the static method printZPLLabelToPrinter.

     

    Let me know if it works out for you.

  • Suggested answer
    Vahid Ghafarpour Profile Picture
    11,974 Super User 2025 Season 2 on at
    Send ZPL code to Zebra printer
    You could design a new ER solution to print ZPL labels
     
    Or using printZPLLabelToPrinter
    class PrintZPLLabel
    {
        public static void main(Args _args)
        {
            // ZPL code for the label
            str zplCode = '^XA^FO50,50^ADN,36,20^FDHello, World!^FS^XZ';
            // Printer name (as registered in Network printers)
            str printerName = 'YourPrinterName';
            // Call the method to print the ZPL label
            WhsDocumentRouting::printZPLLabelToPrinter(printerName, zplCode);
        }
    }

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,028

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 878 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 579 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans