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

To Delete a company

(1) ShareShare
ReportReport
Posted on by 19,856 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
    19,856 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
    19,856 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
    19,856 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
    19,856 Most Valuable Professional on at

    Thank you:)

  • André Arnaud de Calavon Profile Picture
    301,231 Super User 2025 Season 2 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
    19,856 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

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
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 384 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans