Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

Modification to Pick Instructions Report

Posted on by 21

I'd like to change the Bin Code column on the Pick Instruction Report, to Shelf No. from Stockkeeping Units.

I believe I should be able to use Item No. & Location Code from the Sales Line to identify the correct Shelf No. from the Stockkeeping Unit Table.

Within the Pick Instructions Report (214) I added the Stockkeeping Units DataItem under the Sales Line DataItem, which resulted in the full list of Stockkeeping Unit records being added.

I want to filter Stockkeeping Unit DataItem so only the record with the specific Shelf No. is displayed where the Item No., and Location Code from both tables match.

Basically, I need to do a look-up of that shelf number.

I'm not sure how to accomplish that.  Any insight would be much appreciated.                                                                                                                                              

  • BrendonA Profile Picture
    BrendonA 21 on at
    RE: Modification to Pick Instructions Report

    Thank you very much for your solution, it worked great.

    Here is what my code ended up being...

    Sales Line - OnAfterGetRecord()

    //--------------Start-------------//

    IF  Type = Type::Item THEN BEGIN

    Item.GET("Sales Line"."Location Code","Sales Line"."No.", "Sales Line"."Variant Code");

    ShelfNo := Item."Shelf No.";

    END;

    //--------------End--------------//

  • Suggested answer
    JAngle Profile Picture
    JAngle 33,159 on at
    RE: Modification to Pick Instructions Report

    Sorry I neglected that part. The .GET needs the primary key values of the table. In your case salesline.”Location Code”,salesline.”No.”, salesline.”Variant Code” should be sufficient

  • BrendonA Profile Picture
    BrendonA 21 on at
    RE: Modification to Pick Instructions Report

    Thanks for your response.

    You were right about the Code.

    I've followed you up to "...insert something like salesline.type = ..." but I think I have some slightly different requirements.  Trying to work out what to do there.

    I did the following....

    • Added ShelfNo as a Code with Lenght of 10
    • Added Item as a Record with SubType StockKeeping Unit
      • The data I am looking to add is from the Stockkeeping Unit table, not the Item table.  So I used 'Stockkeeping Unit' rather than Item.
    • Added ShelfNo as a Column.
    • Added this code to Sales Line - OnAfterGetRecord()  (
      • IF Type = Type::Item THEN BEGIN
        Item.GET("No.");
        ShelfNo := Item."Shelf No.";
        END;

    I am getting this error when running the report. (no errors on the code in Dev Environment).

    pastedimage1630482438315v1.png

    I suspect this is related to either:

    • not using the proper columns to filter i.e. 'Location Code' and 'Item No.', and/or
    • in some cases, not all items have a shelf no.

    Given that I am trying to obtain the 'Shelf No.' column in the 'Stockkeeping Units' table, where the 'Location Code' and 'Item No.' match the 'Sales Line' columns 'No.' and 'Location Code'.  Are there changes you'd make to that code?

  • Suggested answer
    JAngle Profile Picture
    JAngle 33,159 on at
    RE: Modification to Pick Instructions Report

    What you want is a value per sales line. I’d therefore delete the data item you inserted. Instead you want a section of code to calculate the value and return it to a column.

    One way to do this. Add a new global variable like ShelfNo as a code (guessing - check the item table) and the item table. Go to the OnAfterGetRecord trigger of the Sales Line data item. Insert something like if salesline.type = salesline.type::item then begin

    Item.get(salesline.”no.”)

    ShelfNo := Item.”Shelf No”;

    End;

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans