Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

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

Posted on by 1,745

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

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

    Hi, hope the following can give you some hints.

       

    Thanks.

    ZHU

  • Bhushan Borse Profile Picture
    Bhushan Borse 5 on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

    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?

  • javedakhtar Profile Picture
    javedakhtar 1,745 on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

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

  • javedakhtar Profile Picture
    javedakhtar 1,745 on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

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

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

    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
    javedakhtar 1,745 on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

    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  

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

  • RobertasR Profile Picture
    RobertasR 5,002 on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

    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
    javedakhtar 1,745 on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

    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

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

  • Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: can i generate generate barcode of using dll available in microsoft dynamics nav 2016

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans