Twain Scanner for Dynamics NAV that works in remote desktop

A few days ago I published objects for NAV 2013 and details on how to use a twain scanner with the hardware hub.

I know that many happy Dynamics NAV users are still using older versions so I wanted to make this solution available for NAV 2009, both in the Role Tailored Client and in the Classic Client.

ClassicHubScanning

If you are running NAV 2009 you should be able to use the attached object to test your scanner.  It should be easy to change the code to work with older versions of Dynamics NAV.

Hub Scanning for NAV 2009

Hardware Hub IIS Service on Objects4NAV.com

Hardware Hub for Dynamics NAV

Well, of cource you can use this hub for other software but I created it for NAV.

Lets look at these issues

  • You can’t support the hardware directly within NAV
  • You like to have one method of communicating with hardware from NAV
  • Your hardware is on another machine
  • Your hardware is on the client machine and you are running NAV as a Remote Application
  • Your hardware is on the client machine and you are using remote desktop for your work

This is why I created the Hardware Hub Web Service.

HubDescription

This is an open Web Service that can be used to move data between NAV and a device interface.

To use the hardware hub you will need to create a GUID string.  This you can do with the C/AL command FORMAT(CREATEGUID).  This string is stored in a text(50) field in the database.  When you send a request you include this unique identifier and when you use the receive command to check for commands you use the same unique identifier.

Attached is the Hub Proxy Class to use with NAV.  In a production environment the Hub Proxy Class should be places in the service tier Add-ins folder.  I also attached a test page that you can use to test the hardware hub service.  The test page is running the proxy class on the client side so you will need to copy the Hub Proxy Class (HardwareHubProxy.dll) into the Role Tailored Client Add-ins folder.

WebServiceTest

TestHardwareHub

Hardware Hub IIS Service on Objects4NAV.com

Scanning in Remote Desktop

When running Dynamics NAV as a Remote Application or in Remote Desktop you are missing connection to your locally connected scanner.  I have created a solution that uses a standalone application running on the client computer.  That application uses the TwainControlX from Ciansoft and connects to a Microsoft SQL database.  The database needs to be on a computer that both the client computer and the remote desktop computer have access to.

On that database server a database is created with only one table.  That table can be truncated every night in a maintenance job.  This is the table creation script.

The program on the client then connects to the database and to the scanner.

A code in Dynamics NAV creates the request for a scan by inserting a entry into the ScanRequest table and the application on the client computer automatically scans the images and updates that scan request entry.  The updated entry then containes the image file that is imported into Dynamics NAV or attached as a link.

The following ZIP files are encrypted.  View the Product page for more information.

Twain Scanner (ISL)
NAV Myndlestur (TwainOCX) Source Code (ISL)