Developer forum

Forum » Integration » D365 BC integration orders in multiple companies

D365 BC integration orders in multiple companies

Chris Søgaard
Chris Søgaard
Reply

Hi DW

We have a customer that runs a D365 BC v. 21 with multiple companies within the same tenant. We are using DW Plug-In unit version 1.2.0.32. 

We are looking into a project, where we need to create orders on different companies within the same tenant. I can't seem to find any variables in the plug-in unit source code, that allows us to control in which company a specific order is placed. Is it possible to do so, and if yes which event subscriber is the correct one to use.

Also I can't seem to find source code to DW plug-in unit newer than 1.2.0.27 in the repos, so I used that version as reference even though customer is running a newer version.

BR Chris


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Chris,
the source code for 1.2.0.32 version is now available in the repository (the problem was that PR wasn't marked as completed).

I am not sure how it can be possible to have order being placed to the other company/companies. You would probably need to use the 
DynamicwebOrdersPublisher :: OnAfterCreateOrder event for subscribe, that is the last event that is fired in our codeunit when the order is created in BC.

BR, Dmitrij

 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitrij

Thank you for your response. I will get the newest source code for this.

My problem is, that I don't see any variables in the plug-in unit (which is installed on tenant level as I understand it), where we can control in which company the order is created (or simply get data from a specific company in the tenant). The reason for this is that our customer runs a seperate company for their UK business within the same tenant as the rest of EU using Company Hub https://learn.microsoft.com/en-us/dynamics365/business-central/company-hub. So when a order comes in to the BC, some orders needs to be placed in the UK company and others need to be placed in the EU company.

But if you don't have any prior requests regarding this, I guess it is not supported with extensions other than creating a custom method in plug-in unit.

BR Chris

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

Hi Chris,
yes, we have never tried that previously so it will require the custom coding for that. It will probably require the ChangeCopmany() methods and then find how to deal with lots of Validate calls... I have found some examples here: https://businesscentralgeek.com/how-to-use-changecompany-function-in-business-central
BR, Dmitrij

Votes for this answer: 1

 

You must be logged in to post in the forum