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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

To Delete a company

(1) ShareShare
ReportReport
Posted on by 20,825 Most Valuable Professional

Hi,

Trying to delete a company in Microsoft AX 2012 R3.

Deleted all the transactions via trans delete but delete button is still inactive.

It was assigned to hierarchies but I had deleted from those. and activated the hierarchies.

Still delete button is inactive.

Is there a way to delete the company?

I have the same question (0)
  • kbendrikar Profile Picture
    65 on at

    Try to Go to AOT -

    Run the Class "SysDatabaseTransDelete" this will delete all the transactions..(make sure if this really wanted )

    When all the transactions are deleted go back and try again.

  • BillurSamdancioglu Profile Picture
    20,825 Most Valuable Professional on at

    That is the case actually.

    I did this but still the button is greyed out.

  • kbendrikar Profile Picture
    65 on at

    Is there any custom table related to this and has relations?

  • BillurSamdancioglu Profile Picture
    20,825 Most Valuable Professional on at

    No.

    I am only suspend of the standard organization hierarchy. While there were non active hierarchies, may it not be possible to delete?

  • kbendrikar Profile Picture
    65 on at

    try to remove hierarchy -

    pastedimage1664378866035v1.png

  • BillurSamdancioglu Profile Picture
    20,825 Most Valuable Professional on at

    Already removed. But I was mentioning the hierarchy of the past log.

  • Verified answer
    kbendrikar Profile Picture
    65 on at

    Try to delete these records - the delete button will be enabled

    delete from OMHierarchyRelationship  where ChildOrganization  == companyInfo.RecId

    delete from OMHierarchyRelationship  where ParentOrganization == companyInfo.RecId

    delete from OMRevisionEdit  where ParentOrganization == companyInfo.RecId

    delete from OMRevisionEdit  where ChildOrganization  == companyInfo.RecId

  • BillurSamdancioglu Profile Picture
    20,825 Most Valuable Professional on at

    Thank you:)

  • André Arnaud de Calavon Profile Picture
    304,900 Super User 2026 Season 1 on at

    Hi Billur,

    You got your solution already. The organization hierarchies are based on date effective tables. When you delete a legal entity from the hierarchy, it will actually set an end date instead of deleting the records in the table OMHierarchyRelationship. For that reason, the solution provided by Kiran was your answer.

  • BillurSamdancioglu Profile Picture
    20,825 Most Valuable Professional on at

    Thanks André,

    The problem is even we removed from the hierarchy, delete button was inactive. So we deleted past records from the table and now the button is active.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 660

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 655 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 557

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans