Hi Dynamicweb,
In Dynamicweb 10 I have a problem with setting the correct StockLocationGroupId when importing stock locations where I only have the stock location name in the incoming data. When I use EcomProvider, data is created in EcomStockLocation. StockLocationId has auto identity increment, but StockLocationGroupId should be set to the same id as StockLocationId when only one language is used. Instead, the value is set to the latest StockLocationGroupId + 1. It is a problem when rows are deleted and new stock locations are inserted.
Any suggestions on how to set the StockLocationGroupId correctly?
Best regards,
Niels Foldager
Developer forum
E-mail notifications
EcomStockLocation - problem setting correct StockLocationGroupId
Replies
Hi Niels,
there is no relation btw the StockLocationId and StockLocationGroupId column values. The StockLocationId is autoincremented while the StockLocationGroupId is not.
The StockLocationGroupId field is used to store the actual stock location id value, fx here is sample of data that is coming from D365BC to store it in the DW [EcomStockLocation] table.
If you don't have the ability to get the StockLocationGroupId value from your source, then you can look for a solution for getting the location id, as an example you can consider to get the id using the code like locationNameStr.GetHashCode() then in the Data integration job you can have a mapping like that with using the @Code feature to generate the Ids:
@Code(Math.Abs(data["Name"].GetHashCode()))
The standard functionality in the EcomProvider is working like that:
If you don't have the column mapping for the StockLocationGroupId field then it tries to find the existing StockLocation by looking on the source StockLocationId value (if present in the source row and mapping) and then if not found by the source StockLocationName value.
So maybe you can consider making the StockLocationName as your Key Column in the mappings and it can solve the issue once the StockLocationIds or StockLocationGroupIds are not present in the source data.
BR, Dmitrij
Hi Dmitrij,
Thank you for your feedback.
Best regards,
Niels Foldager
You must be logged in to post in the forum