Developer forum

Forum » Integration » Live Integration issue when

Live Integration issue when

Ricardo Pereira
Ricardo Pereira
Reply

Hi,

I'm experiencing some issues on the Live Integration when “Cart communication type” is set to “Full”.
When a user repeatedly adds the same product to the cart, multiple orderlines are being created and discounts are displayed out of place (image attached)

Has anyone run into this issue?
 

DW 9.9.5
Live Integration 3.0.3
BC Cloud 18.1
Codeunit 1.2.0.16

Screenshot_2.png

Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Ricardo,

We are experiencing something similar in DW 9.9.8.

The problem seems to be related to how the orderlines are processed in the ERP after the first request.
We had to customize the Live integration code and we have also asked for some changes on the NAV side.

I am not sure if there is an easier/standard way for solving it.

Adrian

 

 
Nicolai Pedersen
Reply

If any of these values are different, the orderlines will not be 'merged' and you will have several orderlines looking the same.

So it is worth looking at the data of the orderlines that are not put into one orderline... Maybe in the orderline field values there is something hiding?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

In our situation the orderlines were duplicated after receiving the response from NAV. I am not sure if this is the case for Ricardo.

If NAV replies with a promotion, it also adds an orderline field mentioning the promotion name (at least that's how it was in our situation) which makes that Orderline unique. And in some cases (I still have not figured out why) it sends the product orderline duplicated.
We have managed to solve it partially by deactivating sending of orderline field values back to NAV. But we still see some situations where the orderlines are simply duplicated.

I have an example of on order from this morning:

We are still debugging the reasons for this duplication.

But I don't want to hijack Ricardo's post :)

Adrian

 
Ricardo Pereira
Ricardo Pereira
Reply

Thank you for the quick responses.

It looks like OrderLineId and OrderLineParentLineId are different from the request to the response:

Request:
<item table="EcomOrderLines">
    <column columnName="OrderLineId">OL51581</column>
    ...
</item>
Response:
<item table="EcomOrderLines">
    <column columnName="OrderLineId"><![CDATA[10000]]></column>
    ...
</item>


Does it looks normal that the OrderLineId and OrderLineParentLineId changes in the response?

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Ricardo,
yes, that is by design, the response order lines contains the generated ids by the codeunit in NAV/BC.
Then the order lines are matched by finding the needed lines by OrderLineProductNumber in the Live integration.
You can look in a source code of the LiveIntegration project, file OrderHandler.cs.
BR, Dmitrij

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

>> Then the order lines are matched by finding the needed lines by OrderLineProductNumber in the Live integration.

And this is where some stuff breaks, currently. The LI code looks in the NAV data for a matching product by its product number. However, when Dynamicweb cretaes a prooduct discount, no product number is added to the discount line (anymore, or has it always been like that?). This will cause a mismatch and all kinds of weirds things to happen. I recently ran into this in a project for DWS with standard LI integration and we had to resort to a custom one to fix this, and some other issues.

I have "write bug report to Dmitriy" on my Todo listr for a while. Let me know if you want to see what I did Dmitriy and we can schedule a call or so.

Cheers,

Imar

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Imar,
it has always been like that. Yes, I want to see your solution for this.
Are you using a standard NAV codeunit/BC extension with no customizations? What re the versions of DW and Live integration?
Can you provide your xml requests and respones after which the Dynamicweb does not merge the order lines?
BR, Dmitrij

 
Ricardo Pereira
Ricardo Pereira
Reply

Hi Dmitriy,

So does this mean that we will have a bug fix soon?

BR, 
Ricardo

 
Nicolai Pedersen
Reply

Hi Ricardo

It means that you need to provide some more information or look into the live integration to see what i happening so we can see if this is something we can change.

BR Nicolai

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Ricardo,
what is your Live integration configuration? Who is handling the discounts: BC or Dynamicweb? If it is Dynamicweb could you show your discount settings from Dynamicweb Ecommerce?
Or  you can share your solution url if possible.
Thx
BR, Dmitrij
 

 
Ricardo Pereira
Ricardo Pereira
Reply

Hi Dmitriy,

BC is handling the discounts.
I'll send you an email with the solution URL.

Thanks,
RP

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
Hi Ricardo, I have looked into your solution and found that it is connected with the Live Integration Use unit prices option selected. Problem is that at first product addition to the cart the BC returns the BC item Base unit of measure in the response, so then DW keeps two orderlines. That is probably a bug and I will look on it, but for now you can try to uncheck the Use unit prices checkbox and check if it solves this issue. BR, Dmitrij
 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Ricardo,
that is a bug in the BC Dynamicweb Plugin unit extension, the problem is that it always returns the value in the response field OrderLineUnitId,
the value there is a BC product Base unit of measure Id or
Unit of measure id that is got from Dynamicweb in the orders request(but it is empty by default since the Add to cart is adding a product with empty unit id).
That bug will be fixed in the next BC Dynamicweb Plugin unit release.

As a workaround you can try to make this code change in your LiveIntegration code in the file OrderHandler.cs:
comment out this line:
//orderLine.UnitId = unitId;

Another workaround is to make a Dynamicweb to send some default BC product unit id in the request.
That can be probably done by some template "Add to cart" unit id hardcoding or
add a default Unit of measure of your product in DW so it matches the Base unit of measure in BC,
you need populate the table [EcomProductUnitOfMeasure]

or do that in Ecom product edit UI,
then on the frontend you will see the UI for the available products units when adding to the cart, it could look like that:


BR, Dmitrij
 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Ricardo,
This issue was solved. The new version of the Dynamicweb Plutin Unit 1.2.0.17 is now released on the MS App Source.
BR, Dmitrij

 

 

You must be logged in to post in the forum