dynamicweb / DynamicWeb

Make feature requests for Dynamicweb in Issues section of this repository
https://doc.dynamicweb.dev/documentation/fundamentals/support/feature-requests.html
GNU General Public License v3.0
1 stars 0 forks source link

Flow change to business central #51

Closed dwlhs closed 4 months ago

dwlhs commented 6 months ago

In a project for a customer, not all products are registered in BC, and we want to add a remark on the order line, when DW sends an order including an unknown item number.

In the CreateOrder method in the standard codeunit, when iterating through the order lines sent from DW, we do a look-up on the item number to validate that the item exists, before adding the line. If the item doesn't exist in BC, the codeunit will throw an error.

The problem is that the OnBeforeCreateSalesLine event is invoked after this validation, so we don't have any opportunity to catch this and perform the special logic that applies for these scenarios.

image

It seems that we need to hook into the OnBeforeCreateOrderRequest and inspect and manipulate with the information on the order lines in the input xml before it is sent further down the pipeline.

It would be helpful, if the validation was moved until after the OnBeforeCreateSalesLine event has been invoked.

DynamicRas commented 6 months ago

Hi,

Makes sense. We will take a look at it.

BR Rasmus Sanggaard