Developer forum

Forum » Integration » Use a different field from BC when requesting Live Stock

Use a different field from BC when requesting Live Stock

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi,

On a DynamicWeb 9.12.7 with latest Swift solution connected to Business Central I need to change the way the Live Integration handles stock.

By Default the field (in dutch) "Voorraad" is used, but the actual available stock at this moment is "Artikelbeschikbaarheid" which is a calculated field in BC that also takes reservations and orders being processed into account.

Sinc the calculation for the field "Artikelbeschikbaarheid" in Business Central is quite a heavy process we cannot synchronize this to the entire catalogue on a regular basis, so my thought is we only request this when Live price and stock for a product is requested to BC.

Can we do this on the BC side by adding a handler for "OnBeforeGetProductStockRequest" to the extension code unit, which then replaces the standard stock field with the value of the calculated field, or would that then also run if I request the entire product catalogue in a batch import?

Thanks,

Justin


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Justin,
there is a new notification in the latest BC app version you can use to override the default stock or other product information for the Live Integration from BC:
Codeunit DynamicwebProductsPublisher
OnAddItemCustomerOnBeforeAddItemUOM:
procedure OnAddItemCustomerOnBeforeAddItemUOM(var item: Record Item; var xmlNode: XmlNode; requestXmlNode: XmlNode);

So you can use it and override tha 'ProductStock' xml tag with your own value.
BR, Dmitrij

Votes for this answer: 1

 

You must be logged in to post in the forum