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 17,153 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?

  • BillurSamdancioglu Profile Picture
    17,153 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
    292,935 Super User 2025 Season 1 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
    17,153 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
    17,153 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
    17,153 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
    17,153 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,935 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,801 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans