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.
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--------------//
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
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....
I am getting this error when running the report. (no errors on the code in Dev Environment).
I suspect this is related to either:
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?
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;
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... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156