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)

How We can delete Legal entities in demo database in AX 2012 which are having Organization Hierarchy

(0) ShareShare
ReportReport
Posted on by

Hi friends

I am trying to delete companies from legal entities,Companies with Organization Hierarchy I am not able to delete.like 'Contoso Retail FR' in AX 2012 because this company is having Organization Hierarchy,you can see

View in Hierrachy is enabled at legal entity form,how can we delete these legal entities any idea??

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hello sanjay.1816,

    Rather than trying to delete something from existing hierarchies, isn't it faster and easier to simply create a new hierarchy?

    Especially if you work with the contoso demo data, a lot of setups have to be taken into consideration and I believe creating a new hierarchy is the fastest way to go forward.

    Best regards,

    Ludwig

  • Community Member Profile Picture
    on at

    Hi Ludwig,

    I am trying to delete legal entities which are not of our use,but some entities are having organization hierarchy,there delete button is disabled,can we delete those legal entities

    How can we do

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi sanjay.1816,

    As you are working in the contoso environments, can you share details of the hierarchy and Company you refer to and I can have a look in my demo system.

    Many thanks,

    Ludwig

  • Community Member Profile Picture
    on at

    Hi Ludwig,

    I am workin in AX 2012 R3 CU8 demo data base(latest).As you can see FRRT(Contoso Retail FR) Legal entity is 'IN Hierarchy' checked on Legal Entity form,so delete button is disabled,there are other companies also of similar kind.

    How can we delete them.

  • Community Member Profile Picture
    on at

    Hi Ludwig,

    Some one has written to do below steps

    1.Ran the "SysDatabaseTransDelete" class.

    2.Deleted all organizational hierarchies.

    3.Followed André's helpful suggestion to comment out the code in the aosValidateDelete method on the Batch table.

    4.Deleted all batch jobs for company accounts I planned to delete.

    5.Removed user organization assignments. (You can use the OMUserRoleOrganization table to make sure you have removed all of them.)

    6.Deleted legal entities.

    Can we look these steps to delete companies with Organization Hierarchy.

  • Community Member Profile Picture
    on at

    I deleted rec id of CompanyINFO against an entity from OMHirerachyrelationship table

    childorganization Field.OMHirerachyrelationship  table is present at OMHierarchy Query

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi sanjay.1816,

    Why are you trying to do the modification from the AOT?

    Can't you just edit the org. hierarchy, remove the legal entity and publish the new structure?

    Best regards,

    Ludwig

  • Community Member Profile Picture
    on at

    Hi Ludwig,

    I am technical ,not having functionality knowledge,Where can I delete legal entity from Org. Hierarchy..can you guide me.

  • Community Member Profile Picture
    on at

    Hi Luwig,

    After deleting from Front end(Oraganization Hierarchy).Still reference is left at table.

    So I am trying at AOT level.

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi sanjay.1816,

    You will always see the checkmark in the legal entity form because the hierarchy needs to be published with a datetime stamp. Meaning that you can change and modify an existing hierarchy. However, a hierarchy that has been published cannot be deleted from UI. I have not tried deleting an older version of a once published Org.Hierarchy but would imagine that this can cause some difficulties because those hierarchies have a lot of integrations - for example with Workflows and the Management Reporter. So, if you delete them from backend, please carefully test all of your processes, Workflows and Reports to ensure that they still work properly.

    Best regards,

    Ludwig

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