Developer forum

Forum » Integration » Integrates available stock with sales unit of measure instead of base unit of measure.

Integrates available stock with sales unit of measure instead of base unit of measure.

John Cristian Villamar Cueva
Reply

Hi everyone, I ask you for help with the following, I am doing a stock integration between Business Central and Dynamicweb, but it has a peculiarity, BC manages a base unit of measure and two sales units of measure, however in the ERP the stock is managed entirely in the base unit of measure, but to DW I must pass the available stock in sales units of measure.

I explain the process with the following example:

I have the Orange Flavor product, it is handled in Kg and is sold in 1 Kg jars and 2 Kg bottles. The availablg of this product in the blue warehouse is 51 Kg and in the green warehouse it is 32 Kg.
I should transfer to DW, that the Orange Flavor has stock available in the Blue warehouse of 51 bottles if the customer wants to buy bottles and 25 bottles if he wants to buy bottles,. and the green warehouse has 32 jars and 16 bottles.

I think you should do some customization on one of these events ProductsPublisher.OnBeforeGetProductStockRequest / ProductsPublisher.OnAfterGetProductStockRequest.
But what code should I use to replace the available in Kg, by the available in jars and bottles?
How do I include the data of warehouse and unit of measure?
Because when I use Get Product Stock Simple or Get Product Stock Advance it doesn't show the warehouse and unit of measure, in the retrieved data.
I would really appreciate it if you could give me some information on how to solve this requirement.


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Dynamicweb supports BUOM and can recalculate from that to your SUOM. See https://doc.dynamicweb.com/documentation-9/ecommerce/product-catalog/product-units#3468

This might solve your issue without customization. 

 
John Cristian Villamar Cueva
Reply

Ok, then where can I integrate the available balance of my product for each warehouse in BUOM, and when would It recalculate the SUOM?

When I use "Get Product Stock Advance" to integrate BC to DW, it does not retrieve the Location Code or the BUOM Code

    <item table="EcomProducts">
      <column columnName="ProductID"><![CDATA[0010133]]></column>
      <column columnName="ProductVariantID"><![CDATA[]]></column>
      <column columnName="ProductNumber"><![CDATA[0010133]]></column>
      <column columnName="ProductStock"><![CDATA[0]]></column>
    </item>

Is the recalculation process done during the integration, or is it done entirely in DW after I integrate the stock with the "Get Product Stock Advance" function?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I am not sure about the BC side. But in Dynamicweb you need to move the data to the stock matrix table "EcomStockUnits" table.

Your XML above is integrating to the ProductStock field on product record and when working with BUOM and SUOM this field is not used for anything - it is all handled by units and stocks.

So these places in the UI:

In units setup your BUOM and SUOM and their connection (1btl = 1 kg etc)

Then in stock, you add the stock level for the BUOM.

That would be this part of the integration:

https://doc.dynamicweb.com/documentation-9/integration/integration-framework-old-structure/remote-system-setup/dynamics-365-business-central/codeunit-mappings#20462

 

You must be logged in to post in the forum