I recently was asked to redirect a invoice printout to different printers depending on a code variable on the sales invoice header.  The solution was created and I would like to share it with the example of using printers by location.

After installing this solution you will be able to select a invoice printer for each location.  If non is selected then the default printer from Printer Selection table will be used according to standard Dynamics NAV functionality.

PrinterByLocationCode

4 thoughts on “Printer Selection by Location Code

  1. Vu Trung Hieu says:

    Hi Gunnar,

    I have tested your code on Demo Database which provided in the Installation Package of Dynamics NAV 2009 R2. However, it does not work. The report in Posted Sales Invoice just use the default printer.

    Then, I tried some modification such as changing the Temporary property of PrinterSelectionBuf to No. I found that No Record was created in Printer Selection table. Do you have any idea why your code does not work?

    Regards,
    Hieu Vu

  2. The code includes changes in Codeunit 1. Did you remember to close the company and reopen after importing the code ?

    I tested this on a CRONUS database and it works for me.

  3. Soren Smith says:

    Hi Gunnar,

    I would like to see the solution, but I can’t find a download link to objects – nor a link to see the code bits.
    Am I missing something here, or could you make sure a link is visible for download?

    Thanks.
    Kind regards

    1. It lookes like the objects are attached in the bottom of the post

Leave a Reply

%d bloggers like this: