25 Apr’19

D365 Business Central

Managing 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

  • How to enable Document ID in SharePoint Online

    16 May’ 2019

    Introduction: As you know that SharePoint Online can be used as a document management platform and with the help of Docu...

    Read more
  • Count Number of files in SharePoint folder

    15 May’ 2019

    Introduction: This blog explains how to Count No of files in SharePoint folder using MS Flow. Steps to be followed:Sel...

    Read more
  • Professional Services Automation (PSA) for CPA firms

    14 May’ 2019

    With the evolution of Technology, every industry is getting process oriented and so are CPA firms getting more organized...

    Read more
  • What if the Resource Requirement Still appears post the task is deleted from Schedule (WBS) in PSA V3?

    13 May’ 2019

    Problem Definition: I have observed a fact in PSA that when the task in PSA Schedule (WBS) is deleted, the corresponding...

    Read more
  • Discount Settings for D365 Sales Line Items – Line Items or Per Unit?

    10 May’ 2019

    For Line Item entities Opportunity Products, Quotes Products, Order Products or Invoice Products, you can chose what typ...

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