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 :
Microsoft Dynamics AX (Archived)

Company abcd is already associated with a legal entity. Select a different company.

(0) ShareShare
ReportReport
Posted on by

When I click on Main account and select a specific account, I am receiving the error warning:  Company XXXX is already associated with a legal entity.  Select a different company..

We restored the AX db from 1 server to another and followed the restorations steps / scripts. I am able to see all the data in the new environment however get this type of error. Appreciate any help on what step am i missing or overlooked.

*This post is locked for comments

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

    Hi Prem,

    Can you provide some more information? Is it still working correctly in the original environment? Did you restore both the AX business database and model database? What restoration steps did you do?

    I have seen a similar error before. Are there any roles assigned to this user? Do you have this error with the system administrator role assigned?

  • Community Member Profile Picture
    on at

    Hello Prem

    I found that this message is given by the "validateWrite" method on the "CompanyInfo" table but I have no idea why this is thrown while selecting a record in the "MainAccount" table. By the way, is the error thrown when setting the focus on a line in the MainAccountListPage or when opening the record for editing?

    Anyway this sounds like an inconsistency in your data. Are'nt there any doubles in the copied tables? Like André asked, I am wondering if you copied both databases; data and model store.

    Maybe a simple first step could be to perform a Consistency check in " System administration - Periodic - Database - consistency check.

    Kind regards

    Hans-Peter

  • Verified answer
    Community Member Profile Picture
    on at

    I did some additional troubleshooting and I went back to doing the steps all over again. Restored the AX dbs and ran the scripts and this time around it seems to be working fine and not throwing any errors. Not sure if its something I did incorrectly or missed a step. Will go over everything again to be sure.

    Thanks for the quick response Hans-Peter / Andre

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

    Hi Prem,

    If the second attempt worked for you, you solved your own problem. If you can find the cause, it would be nice to know what happened. You can mark your own answer to have the question getting the status answered.

  • Suggested answer
    Anton Ivanov Profile Picture
    on at

    Hi,

    We have the same issue and the problem was in the table “MainAccountLegalEntity” where the field “LegalEntiry” was with incorrect values (probably copied from another installation).

    We just replaces values in the table with correct value and everything was OK.

    BR,

    Anton Ivanov

  • Community Member Profile Picture
    on at

    Please Run full compilation and then Database synchronization. Hopefully this issue will be resolved.

  • Atef abdel monem Profile Picture
    15 on at

    Hi Anton 

    how did you know the correct value ?

  • manikumar Profile Picture
    1,623 on at

    this is not a solutions for the problem, if you think doing all steps again will solve your problem means you shouldn't have posted before.

  • OyvindBerg Profile Picture
    25 on at

    Hi!

    The reason for this error message could be that you had records in table MainAccountLegalEntity with not existing values in the field LegalEntity. This might occur when a company is deleted and the company specific records for the main accounts remains in this table.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans