Hi,
we are working on an integration project using DW LSIntegration project agains a customer LSRetail implementation.
In LS the web store is configured to have multiple locations.
This is done because the webstore sells items that can be picked up from multiple stores so we need access to availability and stock from each location.
During data import batch job a duplicate key exception is thrown.
public static Dictionary<string, decimal> GetStock(string shopId, string itemId, string variantId, string serviceUrl)
{
Dictionary<string, decimal> result = new Dictionary<string, decimal>();
EcommerceService.IeCommerceServiceClient client = Config.GetClient(serviceUrl);
EcommerceService.InventoryResponse[] inventories = null;
inventories = client.ItemsInStockGet(shopId, itemId, variantId, int.MaxValue);
foreach (var item in inventories)
{
result.Add(item.StoreId, item.QtyInventory);
}
return result;
}
The exception occurs because we have two inventory responses and both have the same StoreId.
Reynir