Posted on 28/11/2023 13:18:49
Hi Adrian,
In a project in DK we needed almost-live inventory numbers, but we're not doing live integration for the reasons mentioned by Nuno and Nicolai. Instead, we planned 5 minutes scheduled task with the URL Builder that first sends new orders to bc and then updates the inventory numbers in DW, both using OData (the scheduling was actually changed, I believe, but someone else on this forum can elaborate on that :) ). Then, it is disconnected from the user context, an while the synchronization is waiting to run, Dynamicweb balances its own inventory as orders arrive.
We were able to do this with the Items page as an webservice, because we just need the "Inventory on Hand" minus "Qty on Sales Orders", and OData is blazingly fast to serve the information. In your scenario, however, it is a bit more complicated, because the inventory in a specific locations is the result of a calculation and not a number that we can just pick from BC. It should probably also exlude the units that are reserved for orders to avoid overselling. So, you need someone to extend the codeunit or provide an alternative endpoint for you to fetch the information. In the specification for that you might want to include a delta possibility to only update the inventory numbers that have changed since last sync to have a lighweight sync after the order sync, and a full sync possibility to get all the inventory numbers to run a couple of times a day or whatever you see fit.
In our scenario, DynamicWeb is (usually) the only outlet, so the inventory in BC and DW should be pretty close all the time. If that is not the case in your scenario, you might condsider looking into webhooks to have the inventory updated in Dynamicweb, when an update is recorded in BC.
Br.
Lars