Developer forum

Forum » Integration » Child lines not removed

Child lines not removed

L. B. Wassini Dynamicweb Employee
L. B. Wassini
Reply

We are encountering some unexpected issues with a customer solution using Live Integration.

Background:

The customer operates in a country where, by law, a specific line item (Künstlersozialversicherungsabgabe) must be added to orders when selling certain products, such as satellite receivers. Their Business Central (BC) instance has been customized to include this line. We are using Full Card communication to retrieve the recalculated order. The line must be visible to the customer, so its order type is set to 0.

When submitting a sales order to BC, new product lines do not include a SalesLineId (in the XML sent to BC). BC (re)assigns these IDs sequentially (e.g., 100 for the 1st line, 200 for the 2nd), and the SalesLineParentLineId is assigned to related lines (e.g., 100 for the 2nd line).

Issues:

  1. Order Line Reference is not preserved
    When retrieving the updated order from BC, the SalesLineParentLineId is not set in EcomOrderLines. Could this be because both the parent and child lines are set to type 0? It is essential to keep this type for the special line as this must appear visible to the customer as an item line and not as a combined tax.

  2. Additional Line is not removed
    When the original product is removed, the added line remains visible. Even when the sales order is returned from BC with no lines, the line persists in the cart. Could this be because the SalesLineParentLineId is not set correctly?

Thanks

Lars Bo

 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Lars,

1) It keeps the values for the OrderLineParentLineId when it is a discount child line of OrderLineType=3, otherwise the column OrderLineParentLineId is not included in the response

2) Yes, seems like it looses the relation

The problem is that the LineIds are overwritten with the default BC numbering like 1000, 2000, etc then if the value for the field OrderLineParentLineId is not empty in the response the Live integration tries to find the parent line by looking on the field OrderLineProductNumber and if finds the line with that product then the relation is made.

So could you consider sending this additional order lines as of type 3=Discount to BC and have Live integration option "Use Dynamicweb discounts" on and set the appropriate product number that relates to the needed parent line? You can use custom subscribers in the Live integration to change the line types before/after the request.

BR, Dmitrij

 
Lars Bo Wassini Dynamicweb Employee
Lars Bo Wassini
Reply

I don't see how this will solve the problem with the additional line not being deleted, when the "parent" product is deleted from the cart.

We don't know when to add the fee (this information is only available in BC), so we have to make the change in the BC Code Unit to send us the line as a type 3, and then "convert" it to a type 0 when receiving. But still this will not solve the problem with delete.

I have tried to change the OrderLineParentLineId on the fee line (type 0) directly in the database, but it is still not used when deleting the parent line.

 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Lars,
can you send me the following information:
1) 1st response from the BC where the line is introduced
2) next request and responses where the problem occurs

BR, Dmitirj

 
Lars Bo Wassini Dynamicweb Employee
Lars Bo Wassini
Reply

Sure.

I'll send it directly as it contains customer information and prices.

 

You must be logged in to post in the forum