Developer forum

Forum » Integration » Stock Location on D365 BC Cloud

Stock Location on D365 BC Cloud

Chris Søgaard
Chris Søgaard
Reply

Hi

I'm trying to get StockLocations from D365 BC Cloud. Plug-in unit is installed on customer BC.

Trying to call the endpoint with request for getting StockLocations like this will just result in a timeout:

<GetEcomData>
  <tables>
    <ProductStock type="all" importStockLocations="true" />
  </tables>
</GetEcomData>

Executing the request without the importStockLocations parameter works as intended:

<GetEcomData>
  <tables>
    <ProductStock type="all"/>
  </tables>
</GetEcomData>

Any ideas?


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Chris,
do you have an error message and where the errors occurs, is it in BC or in the Dynamicweb connector service?
Could you describe how your setup works? Can you execute that query from the Dynamicweb Batch and Live Tester tool?
Is it more than 30 min?
Kind regards, Dmitrij

 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitrij

Thank you for the response. There's no error message other than a timeout from the DW Backend, when trying to create the request.

I've setup an Integration Batch with Custom Request Add-In related to an activity/Data Integration. It never runs the activity because the Batch Integration gives a timeout. I'm not using the DW Connector Service for this client, but have the Plug-in unit installed on the client's BC and requesting this plug-in directly from Endpoints in DW Backend.

I've tried using the test tool to execute the request but that gives a timeout after approximately 10 min, but not 30 min.

There's definitely a lot of data on the client side, so I would expect it to take some time. Is there anyway to run this request with pagination, so we do not have to request all of it at once.

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Chris,
yes, indeed the BC operation timeout for SOAP is 8 min. So it is needed either to make a feature request to support a paging for this data, but I am not sure if it will be implement
and when.
Another option could be to write a custom extension that will output the stock locations using some paging, but you will need some custom development in AL|
to make it. We have an example project available for download here:
https://doc.dynamicweb.com/downloads/integration#sideNavTitle1-3
which you can customize: OnBeforeGetProductStockRequest that is an event that you need to subscribe to and provide the output using custom development.
If you need some piece of code that is used for getting the stock statuses I can share it.

Another option could be to use the Endpoint-Odata providers that use the Odata queries but those are in beta version and should be already released in the last 9.10.1 release,
but I am not 100% sure if it works for that data import.

Kind regards, Dmitrij

 
Jacob Nilsson
Reply

We're trying to do the exactly same thing and we don't seem to get any response with importStockLocations="true".
The timeout does not seem to occur anymore but there is just not a response. I've also tried with the qty="10" in test tool and it's the same thing there.

Feels like some sort of bug?

This is instant:
<?xml version="1.0" encoding="utf-8"?>
<GetEcomData Qty="10" ReimportTable="true" SetCheckpointToNow="false" CustomModifier="Test">
  <tables>
    <ProductStock type="all" />
  </tables>
</GetEcomData>
 
This is is forever pending:
<?xml version="1.0" encoding="utf-8"?>
<GetEcomData Qty="10" ReimportTable="true" SetCheckpointToNow="false" CustomModifier="Test">
  <tables>
    <ProductStock type="all" importStockLocations="true" />
  </tables>
</GetEcomData>
 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jacob,
those 2 requests differ, so if you don't need to have the stock locations in the output then you can use the first request.
The second request takes more time as it starts to page the Stock Locations and then it gets all products that belong to those locations and then the BC calculates the stock levels per product and per location so it takes more time to process. The problem can be that for Qty=10 it can take the first 10 Locations and each location can have lots of products in them.
Can you try to decrease the Qty and check if it works?
Do you use one of the latest versions of the D365BC codeunit?
BR, Dmitrij

 
Jacob Nilsson
Reply

Hi Dmitrij,

The point was to illustrate that it works fine and quickly without importStockLocations="true" but not with it and that it does not work even wity small quantities

It is the same with even smaller than Qty=10 and also the same without any Qty. The request just seems to go on forever and we never get a response.

So it seems that any calls with <ProductStock type="all" importStockLocations="true" /> is stuck pending forever which is a bit problematic since the customer has several stock locations for their products.

The DynamicWeb Plug-in unit version is 1.2.0.58

 

 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jacob,
yes, I get it reproduced on the BC with a lot of items. I have created a bug #26479 to fix that.
BR, Dmitrij

 

You must be logged in to post in the forum