Hello Dynamics community!
My first steps into Nav 2016 and I'm getting an error.
I'm connecting a PC
HP RP7800 Retail System
with a cashdrawer
HP Standard Duty Cash Drawer (QT457AA)
I'm connecting the cashdrawer directly (without a receipt printer) and use a "RJ45 from drawer to RJ12 to the PC" cable.
POS Drivers from
here and POS for .NET from
here installed.
In the both packs there are test tools with which I succeed at opening the cashdrawer automatically.
The tools look somewhat like this on the 8 site from this PDF from the OPOS drivers pack
https://drive.google.com/open?id=0B5eop_-6tY07UGgzNG5RVXRtS2c
I have referenced a few DLLs from the .NET for POS Pack and activated the RunOnClient property on them.
My code in NAV
//PosDevice := PosExplorer.PosExplorer;
//PosCommon.
//CashDrawer.
//PosCommon.Open();
// PosDevice.
// PosDrawer.OpenDrawer();
// PoSDrawer := PoSDrawer.OpenDrawer();
//PosExplorer. OpenDrawer();
KassenFunktionen := KassenKlasse.OPOSCashDrawerClass;
KassenFunktionen.Open('HP_CashDrawerPort-1');
KassenFunktionen.DeviceEnabled := TRUE;
KassenFunktionen.ClaimDevice(1000);
KassenFunktionen.OpenDrawer;
PosDeviceCollection := PosExplorer.GetDevices('CashDrawer');
MESSAGE(PosDeviceCollection.ToString);
PosDeviceInfo := PosDeviceCollection.Item(1);
MESSAGE(PosDeviceInfo.ToString);
PosDeviceInfo := PosExplorer.GetDevice('CashDrawer','HP_CashDrawerPort-1');
check := PosDeviceInfo.IsDefault;
MESSAGE(FORMAT(check));
PosCommon := PosExplorer.CreateInstance(PosDeviceInfo);
PosCommon.Open;
MESSAGE(PosDevice.ToString);
PoSDrawer.Open;
PoSDrawer.Claim(10000);
PoSDrawer.DeviceEnabled := TRUE;
PoSDrawer.OpenDrawer;
PoSDrawer.DeviceEnabled := FALSE;
PoSDrawer.Release;
PoSDrawer.Close
//CashDrawer.Open;
//CashDrawer.Claim(10000);
//CashDrawer.DeviceEnabled := TRUE;
//CashDrawer.OpenDrawer;
//CashDrawer.DeviceEnabled := FALSE;
//CashDrawer.Release;
//CashDrawer.Close;
//
//
I just need a piece of code that opens the cashdrawer, the info checks etc arent essential.
Sorry, that there are too many comments. I copied the code as fast as I could and replicated some of it from memory. Didn't want to delete the wrong ones because I'm a newbie. No matter what I tried to change with the code it showed me errors.
The error looks like this:)
I really have no idea
This doesnt help
I will try to answer everything as soon as I get to the code again.
Thanks in advance for the time wasted on me.
Comments
KassenFunktionen := KassenKlasse.OPOSCashDrawerClass; seems not to be a ..net class, maybe an automation call.
i such cases, i always develope the .net part of the code in visual studio (express), to test the part if it works in general.
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
Here's mine:
It says "an instance of the following .NET variable could not be created, so I assumed it's the same as the error posted before, despite different wording.
These are my locals from the drivers that I've installed:
Sorry I don't really understand the concept it being an Automation call and not a class. I'll try to find some info on that.
Meanwhile I'm quickly posting these screenshots to clear out some things.
Using Win10 by the way.
Thanks for the fast respond.
Isn't it enough? I don't quite understand the distinction of Client and Server yet so sorry
Ok.
If the .net dll's is gac'ed then i think you have to define the locals to run on the client:
(Example using my own stuff)
Click on the variable and show properties:
Change 'RunOnClient to 'Yes':