Dear ALl,
i want to generate the barcode of code 128 using Microsoft.Dynamics.Nav.MX dll available in NAV 2016,i had taken two variable
Barcode: dot net type:Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider.'Microsoft.Dynamics.Nav.MX, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Barcodeprovider:dot net type:Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider.'Microsoft.Dynamics.Nav.MX, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Barcodeprovider:=Barcodeprovider;
Barcode:=Barcodeprovider;
Barcodetxt:=Barcode.GetBarcode(Item."No.");
but i am getting an error of
Microsoft Dynamics NAV
---------------------------
A DotNet variable has not been instantiated. Attempting to call Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider.GetBarcode in Report Barcode: Item - OnAfterGetRecord
---------------------------
OK
---------------------------
kindly tell me where i am wrong ?
Hi, hope the following can give you some hints.
Thanks.
ZHU
GetBarCodeProvider(VAR IBarCodeProvider : DotNet "Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider" RUNONCLIENT)
IF ISNULL(IBarCodeProvider) THEN
IBarCodeProvider := QRCodeProvider.QRCodeProvider;
QRCodeFileName := IBarCodeProvider.GetBarcode(QRCodeInput);
It is working for on client but when I run it from Job Queue getting a error
Microsoft Dynamics NAV Server attempted to issue a client callback to create a DotNet object: Microsoft.Dynamics.Nav.MX.Barcode Providers.QRCode Provider (CodeUnit 50024 QR Code Mgt.). Client callbacks are not supported on Microsoft Dynamics NAV Server.
If I set RUNINCLIENT No then getting Cannot serialize an instance of the following .NET Framework object: assembly Microsoft.Dynamics.Nav.MX, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, type Microsoft.Dynamics.Nav.MX.Barcode "Providers." BARCode Provider. in navision
Could you suggest any solution for this?
i dont want any QR code i want barcode of code 128,
i got the text for the path of temp folder but i am not getting any barcodes.
Try:
IF ISNULL(BarCodeProvider) THEN
BarCodeProvider := QRCodeProvider.QRCodeProvider; //This is the constructor that you have to check.
and then:
Barcodetxt:=BarCodeProvider.GetBarcode(Item."No.");
Hi Roberta ,
i tried using this but getting an error.
---------------------------
Microsoft Dynamics NAV Development Environment
---------------------------
Type conversion is not possible because 1 of the operators contains an invalid type.
Automation := DotNet
---------------------------
OK
---------------------------
Hi Javed,
can you try this as the first thing in your function?
IF ISCLEAR(Barcodeprovider) THEN CREATE(Barcodeprovider,TRUE,TRUE);
Robertas
Hi Stefano,
i tried but i am still getting the same error.
Microsoft Dynamics NAV
---------------------------
A DotNet variable has not been instantiated. Attempting to call Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider.GetBarcode in Report Barcode: Item - OnAfterGetRecord
---------------------------
OK
---------------------------
I don't know this DLL, but it seems an not initialized object. Why bot doing directly Barcodetxt:=Barcodeprovider.GetBarcode(Item."No.");
In the above code, Barcode and Barcodeprovider seems to be the same assembly.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,462 Super User 2024 Season 2
Martin Dráb 228,366 Most Valuable Professional
nmaenpaa 101,148