web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

can i generate generate barcode of using dll available in microsoft dynamics nav 2016

(0) ShareShare
ReportReport
Posted on by 1,751

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 ?

*This post is locked for comments

I have the same question (0)
  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    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.

  • javedakhtar Profile Picture
    1,751 on at

    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

    ---------------------------

  • RobertasR Profile Picture
    5,004 on at

    Hi Javed,

    can you try this as the first thing in your function?

    IF ISCLEAR(Barcodeprovider) THEN CREATE(Barcodeprovider,TRUE,TRUE);

    Robertas

  • javedakhtar Profile Picture
    1,751 on at

    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  

    ---------------------------

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Try:

    IF ISNULL(BarCodeProvider) THEN

     BarCodeProvider := QRCodeProvider.QRCodeProvider;  //This is the constructor that you have to check.

    and then:

    Barcodetxt:=BarCodeProvider.GetBarcode(Item."No.");

  • javedakhtar Profile Picture
    1,751 on at

    i got the text for the path of temp folder but i am not getting any barcodes.

  • javedakhtar Profile Picture
    1,751 on at

    i dont want any QR code i want barcode of code 128,

  • Bhushan Borse Profile Picture
    5 on at

    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?

  • Suggested answer
    YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at

    Hi, hope the following can give you some hints.

       

    Thanks.

    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans