web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Legal entity specific code customizations

(0) ShareShare
ReportReport
Posted on by 2,172

Hi,

In X++ there's a method changeCompany() to execute legal entity specific logic.

Is there something available at a larger level?

For eg, if I have 5 different types of customizations on a same form each related to a specific legal entity, what is the best approach?

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    Hi MYGz,

    Can you elaborate? What are your customizations exactly about? What is it what you want to achieve?

  • MYGz Profile Picture
    2,172 on at

    Right now I don't have exact details but the requirement is there will be different kind of businesses in different legal entity on same instance. Eg. Retail, Construction, Salon, etc. And legal entities keep growing.

    There can be legal entity specific customisations on same forms. Is it achieved by changeCompany() or there are some other ways too? On latest version of D365FO.

  • MYGz Profile Picture
    2,172 on at

    I believe change company() is wrong to use here. But I hope you get my point.

  • MYGz Profile Picture
    2,172 on at

    Sorry, changeCompany was wrong to user here. It would be simply getting current entity and checking it and then running specific block. But you get my point.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi,

    Normally a few forms have country region specific modifications. You can check init method in form PurchTable as an example.

    pastedimage1612814677241v1.png

    You could probably follow a similar logic for legal entity specific customizations.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    Hi MYGz,

    If the country/region is determining what fields or code to execute, then you can use the countryregion parameters in coding, but also on fields, form elements and menu items.

    If this is not making the distinct, you probably have to add some parameters for managing what will be shown or executed.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You can tie your logic to country/region codes, or add parameters to the various *parameters tables so that the functionality can be enabled/disabled per company. In most cases your actual code should not have any logic related to legal entities. You just configure different legal entities differently.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans