Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

fix on NAVISION 2018 C/AL CODE .

(0) ShareShare
ReportReport
Posted on by 70

I need to add ID Field in Report , which is based upon the existing Inventory Label Report.  Need to extract the same ID field from the Warehouse Entry table. The idea being that they can post there output into a container, print label and have the container ID on the report as a barcode. 

  • Yathish JR Profile Picture
    70 on at
    RE: fix on NAVISION 2018 C/AL CODE .

    any answers ?

  • Yathish JR Profile Picture
    70 on at
    RE: fix on NAVISION 2018 C/AL CODE .

    OnInitReport()

    OnPreReport()

    gErrorContext.rdSetErrorContext( lcInventoryLabelReport );

    BINDSUBSCRIPTION( gErrorContext );

    OnPostReport()

    Label Parameters - OnPreDataItem()

    IF(

     ( GETFILTER( GUID ) = '' )

    )THEN BEGIN

     lcduInventoryLabelPrinting.jfGetPrintingData( grecLabelParametersTEMP );

     IF(

       ( NOT grecLabelParametersTEMP.ISEMPTY )

     )THEN BEGIN

       CurrReport.BREAK;

     END ELSE BEGIN

       ERROR( lctxtNothingToPrint );

     END;

    END;

    Label Parameters - OnAfterGetRecord()

    grecLabelParametersTEMP := "Label Parameters";

    grecLabelParametersTEMP.INSERT;

    Label Parameters - OnPostDataItem()

    LabelParametersBuffer - OnPreDataItem()

    IF(

     ( gintNumberOfCopies < 1 )

    )THEN BEGIN

     gintNumberOfCopies := 1;

    END;

    SETRANGE( Number, 0, ( grecLabelParametersTEMP.COUNT * gintNumberOfCopies ) - 1 );

    gInventorySetup.GET;

    LabelParametersBuffer - OnAfterGetRecord()

    IF(

     ( ( Number MOD gintNumberOfCopies ) = 0 )

    )THEN BEGIN

     IF(

       ( Number = 1 )

     )THEN BEGIN

       grecLabelParametersTEMP.FIND('-');

     END ELSE BEGIN

       grecLabelParametersTEMP.NEXT;

     END;

     QuantityBarCode := BarCodeMgmt.To_128B(FORMAT(grecLabelParametersTEMP.Quantity));

     grecLabelParametersTEMP.CALCFIELDS( "Item Description" );  

     CLEAR( gtxtExpirationDate );

     IF(

       ( grecLabelParametersTEMP."Expiry Date" <> 0D )

     )THEN BEGIN

       gtxtExpirationDate := FORMAT( grecLabelParametersTEMP."Expiry Date" );

     END;

     CLEAR(gtxtSerialNoCaption);

     CLEAR(gtxtCatchWeightCaption);

     IF grecLabelParametersTEMP."Serial No." <> '' THEN

       gtxtSerialNoCaption := lblSerialNo;

     IF grecLabelParametersTEMP."Net Weight" <> 0 THEN

       gtxtCatchWeightCaption := lblCatchWeight;

     CLEAR( gBarCode128 );

     CLEAR( gBarCode128HumanReadable );

     gBarCode128 := lBarCodeTypeManagement.rdConvertLabelParamsToBarCode( '', grecLabelParametersTEMP, gBarCode128HumanReadable );

    END;

    LabelParametersBuffer - OnPostDataItem()

    Warehouse Entry - OnPreDataItem()

    Warehouse Entry - OnAfterGetRecord()

    Warehouse Entry - OnPostDataItem()


    MY REQUIREMENT IS TO Need to add  ID Field in Report which is based upon the existing Inventory Label Report.  Need to extract the ID  field from the Warehouse Entry  table. The idea being that they can post there output into a container, print label and have the ID on the report as a barcode.

  • Suggested answer
    Amit Baru Profile Picture
    3,029 on at
    RE: fix on NAVISION 2018 C/AL CODE .

    Hi,

    Pls share you code. I will check and give you better solution.

    Regards

    Amit Sharma

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,161 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,942 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans