November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
The cache system in Inventory System - or in other subsystems in Commerce - must be invalidated when there are changes made. The code you used must return up-to-date values. Otherwise it's a bug. Which changes did you make and how?
Regards,
/Q
Hi Quan,
Thanks for the response!
So I used Commerce Manager > Warehouse Inventory tab under a variationContent, I removed the preorderquantityavailable and backorderquantityavailable (they were set to 10 from a previous edit), and set the purchaseavailablequantity to 10 (this was 0).
Each time I run the above code - just to check inventory values (I'll be using the PurchaseOrPreorder request type I think) it still returns the previous edit, 0/10/10.
Is the way I posted above a reasonable way to retrieve if products are available etc? The activities aren't accessible so I can't call them - having to replicate the activity behaviour manually?
thanks!
Dean
Hi,
Firstly make sure your site is properly configured so cache validation between Commerce Manager and front-end (CMS) site is working. If you edit an entry in Commerce, does the change show up in Catalog UI and vice versa?
And looks closely to your code - it is trying to make some requests - aka changes - to the inventory system. If you want to check inventory values, use IInventoryService.Get instead.
Note that IInventoryService works with InventoryRecord, it's not exactly the values represented in CM. CM work with WarehouseInventory record - which is mapped from InventoryRecord, but not necessary the same.
/Q
Hi Quan,
thanks for the update! Can confirm it was definitely user error :P sorry for wasting your time!
IInventoryService.Get is working perfectly - thanks!
Hello,
I'm using the new IInventoryService, the following code:
var response = _inventoryService.Request(new InventoryRequest()
{
RequestDateUtc = DateTime.UtcNow,
Items = new[]
{
new InventoryRequestItem
{
RequestType = InventoryRequestType.Purchase,
CatalogEntryCode = myVariant.Code,
Quantity = quantity,
WarehouseCode = warehouseCode,
ItemIndex = 0
}
}
});
The inventory rows returned appear to be cached - I've tried disabling entry caching in the ecf.catalog.config but no luck.
Any tips :)?
Thanks,
Dean