Sample: Updating SKU inventory
This sample demonstrates how to update inventory quantities for the SKUs that have already been loaded to the database. Restriction: Inventory quantities cannot be viewed in the Management Center. If we are using the Catalogs tool in the Management Center, we must verify the inventory quantities using the SQL statements provided.
About this sample
This sample updates the inventory quantity of the SKU with the part number 'Cords-Black-29W x 28' to 200.
Procedure
Before running this sample, ensure that you have loaded the initial data.
(Developer) On a command line, go to the WCDE_installdir\bin directory.
- (Linux) Open a command line in the Utility server Docker container. Change the directory to utilities_root/bin directory.
For information about entering and leaving containers, see Running utilities from the Utility server Docker container.- Enter the following command:
- (Linux) ./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-nonATP-inventory.xml
(Developer) dataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload-nonATP-inventory.xml
Alternatively for an ATP store, run data load by using wc-dataload-ATP-inventory.XML.
- (Linux) ./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-ATP-inventory.XML
(Developer) dataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload-ATP-inventory.XML
Verifying results
The wc-dataload-nonATP-inventory.xml configuration file updates the inventory quantities for the SKUs loaded in the initial load sample. Verify that the inventory data is loaded by looking at the INVENTORY table:
- To return the inventory quantity for the SKU with the part number 'Cords-Black-29W x 28', enter:
select * from inventory where catentry_id = (select catentry_id from catentry where partnumber ='Cords-Black-29W x 28L')The inventory quantity returned should be 200.
Alternatively for an ATP store to see how a particular store allocates inventory for the SKU with part number 'Cords-Black-29W x 28' enter:
select TrackInventory, BackOrderable, ReleaseSeparately, Creditable, ForceBackorder, ReturnNotDesired, PickingMethod, Discontinued, MinQTYForSplit, QuantityMeasure, QuantityMultiple from baseitem b, itemspc i, storeitem s, distarrang d where b.baseitem_id=i.baseitem_id and b.baseitem_id=s.baseitem_id and b.baseitem_id=d.baseitem_id and i.partnumber='Cords-Black-29W x 28L'
Cleaning up the data
To remove the data loaded in this sample from the database, run the CleanUp.sql file in the /samples/DataLoad/Catalog/IntegrateScenario directory.Note: After running the CleanUp.sql file, we might see that 0 rows are deleted for certain SQL statements. This result is expected, as not all rows are populated with data in this sample.