Notifications
Announcements
No record found.
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?
Hi MYGz,
Can you elaborate? What are your customizations exactly about? What is it what you want to achieve?
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.
I believe change company() is wrong to use here. But I hope you get my point.
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.
Normally a few forms have country region specific modifications. You can check init method in form PurchTable as an example.
You could probably follow a similar logic for legal entity specific customizations.
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.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 592 Most Valuable Professional
André Arnaud de Cal... 478 Super User 2025 Season 2
BillurSamdancioglu 305 Most Valuable Professional