web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 19,036 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)
  • BillurSamdancioglu Profile Picture
    19,036 Most Valuable Professional on at
    RE: To Delete a company

    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.

  • André Arnaud de Calavon Profile Picture
    298,933 Super User 2025 Season 2 on at
    RE: To Delete a company

    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
    19,036 Most Valuable Professional on at
    RE: To Delete a company

    Thank you:)

  • Verified answer
    kbendrikar Profile Picture
    65 on at
    RE: To Delete a company

    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
    19,036 Most Valuable Professional on at
    RE: To Delete a company

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

  • kbendrikar Profile Picture
    65 on at
    RE: To Delete a company

    try to remove hierarchy -

    pastedimage1664378866035v1.png

  • BillurSamdancioglu Profile Picture
    19,036 Most Valuable Professional on at
    RE: To Delete a company

    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
    RE: To Delete a company

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

  • BillurSamdancioglu Profile Picture
    19,036 Most Valuable Professional on at
    RE: To Delete a company

    That is the case actually.

    I did this but still the button is greyed out.

  • kbendrikar Profile Picture
    65 on at
    RE: To Delete a company

    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.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,258

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 631 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans