25 Apr’19

D365 Business CentralManaging with Multiple Legal Entity Data in Microsoft Dynamics NAV / Business Central

Problem Statement:
Well, my client is a Trader of Oils & Fatty Acids and has multiple legal entities to perform various sets of operation on the TRUCK-LOAD(a.k.a. Load). One legal entity creates the Load and schedules it, while another manages with the freight requirements. The information is not shared between both the legal entities. Thus, we need to store the data separately.

 

Pre-requisites:
For Microsoft Dynamics NAV:
– C/Side Development Environment
– Multiple legal entity(Company) setup

For Microsoft Dynamics Business Central:
– Visual Studio Code
– AL Language Extension
– Multiple legal entity(Company) setup

Solution Design:
1. Create two Tables say LoadCompany1 and LoadCompany2 with same fields
2. Set DataPerCompany property is to TRUE on both the tables.
3. In NAV/ BC, there are common tables but the data into the tables are different. Thus, the system has to manage different version for a single table based on an entity that you’re currently working on.
In this case, I need to set data in different tables and synchronize data between them as shown below.

Code:
1. In this case, to synchronize data, I’ve used TRANFERFIELDS function.
Syntax: DestinationRecord.TRANSFERFIELDS(SourceRecord)

2. To change between working companies for the given table, I’ve used CHANGECOMPANY function.
Syntax: Record.CHANGECOMPANY(CompanyName)

Output:
Inserting Loads
Inserting Loads from Table Company1 Load to Company 2 Load

 

After processing, the system Inserts the Load from Company 1 to Company 2

 

 

Modifying Loads:
There is an existing Load in Company 2

 

Modifying the Load in Company1 should modify the Load in Company 2 as well

 

 

And that’s how I achieved synchronization of data between two companies in Business Central. In the same way, we can also do the same task in NAV as well.

Thanks. Happy weekend 🙂

Written by

Olister Rumao

Software Engineer

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Expenses in PSA for Fixed Bid and T&M contracts

    23 August’ 2019

    Problem Definition: One of my clients decided to use Expense module in PSA and to his surprise he could see the amount v...

    Read more
  • Setup Dockers

    23 August’ 2019

    Docker is an independent container platform that enables organizations to seamlessly build, share and run any applicatio...

    Read more
  • Qualify Lead in D365 CE: Select which entity records should be created

    20 August’ 2019

    Wave 2019 Updates brought some really sought-after features. Another one which I would like to bring up is the Lead Qual...

    Read more
  • Early Opt-in for October 2019 Wave 2 Updates

    20 August’ 2019

    August 2, 2019 was when the Wave 2 Updates were to be out. And here we are! By now, you should have gotten the option to...

    Read more
  • Setting Unified Interface App Icons

    20 August’ 2019

    Default App Icons for typical D365 environment look like these.But here’s what you can do to change these to put...

    Read more
  • We respect your privacy.
  • This field is for validation purposes and should be left unchanged.