Search This Blog

Friday 21 February 2014

Barcode Printing with ZPL ZPL II - NAV

Have you had to print barcodes directly into a printer from NAV? Yes, most of us who have clients from the manufacturing or retail domain often have to undergo the cumbersome exercise of developing, formatting and deploying such reports.

However, during a recent visit to one of my clients manufacturing utility I had a chance to work on Zebra printers. Zebra comes with its own set of programming (scripting) language called ZPL and more recently have developed a more robust version of the same language and have baptized it as ZPL II.

There's not much difference between the 2, its just that ZPL II sends commands much faster resulting in less standby when sending commands to print multiple barcodes at once.

And believe me, its much easier to use these commands from NAV and send it to the printer.

So, this is what you need to do.

Create a template using the designer tool which comes along with the driver. Save this file as a text file onto a drive which is accessible to the user.

Share the Barcode printer across the network so that we can send commands to the printer.

Copy the code from the text file and paste it into a section of the report.

The end result looks like below:


So, I saved the contents of the report onto a text file again and send the text file to the printer using the SHELL command.

No formatting hassels!!!


Saturday 15 February 2014

Mail Client Approval System in NAV (Navision)

Recently, one of my clients had a rather unique requirement. The senior management, almost all of whom are a part of a single business family and travel frequently wanted a facility whereby they could approve purchase orders and other such critical documents online.

There are various ways you can do this off course using web services and the simplest one is by making a web page, with approve or reject buttons. And I was pretty much sorted until the client told me that the web page mechanism wouldn't work as they were skeptical of the use of such data over a web page and felt that their data could be at risk from hackers, eavesdroppers and the likes.

So, the next best solution that came to my mind was to build an application however, such applications are not only costly to build but would also require to be enabled for different OS.

So, I thought to myself, why not use an e-mail body for approvals!

It turns out that this is pretty simple. You or the programmer needs to have knowledge about NAV web services and IIS.

In short, what goes into this is the following:


  • Create a Codeunit Web service for approvals
  • Create a mid-layer IIS web service (This web service is used for communicating between 2 other web services)
  • Create a REST web service
  • Expose the REST web service on the IIS
  • While writing the body content of an e-mail create 2 hyperlinks with the hyperlink as the REST web service with parameters (one link for Approve and the other for Reject)

That's it!!!!

That's all that you need to do.

Pretty simple.

For further information and code you can write to me at vrushankmehta@gmail.com