Hi, How do I assign the SKU name to every item from my inventory located in an rack address using global tables? In my model I use 695 positions and 695 SKU, 1 slot per SKU.
Hi, How do I assign the SKU name to every item from my inventory located in an rack address using global tables? In my model I use 695 positions and 695 SKU, 1 slot per SKU.
To do it after all items have been created, you can use the code snippet below (this assign a label named SKU, you can of course also set the name of the item)
Table locations = Table("Locations PTP");
for(int row = 1; row <= locations.numRows; row++) { string address = locations[row][1]; Storage.Slot slot = Storage.system.getSlot(address); if(slot) { for(int i = 1; i <= slot.slotItems.length; i++) { slot.slotItems[i].item.SKU = locations[row][2]; } } }
If you want to do it directly when each item is created, I would recommend to first create a Map that links the addresses and SKUs, since it will be much faster than looking up the correct row for each item.
In the attached model I use a global variable to store the map and fill it in the model reset trigger.
14 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved