Tuesday, June 2, 2015

Dynamics AX 2012: Delete operating unit

AX throws an error "This organisation participates in one or more hierarchies and cannot be deleted" when you try to delete an operating unit if it is used in one or more organizational hierarchy.

Here is a way to delete operating unit,

1) Table: OmOperatingUnit - get recid using name or name alias(this recid will be used in next three steps).

2) Table: DimensionAttributeValue -> Field: EntityInstance -> search recid in this field and delete record.

3) Table: OMHierarchyRelationship -> Field: ChildOrganisation ->  search recid in this field and delete record.

4) Table: OMOperatingUnit -> Field: recid -> search recid and delete record.

2 comments:

  1. Hi Farhan,

    Still I am getting the same error.

    Did it work for you?

    -Wamik

    ReplyDelete
  2. Yes.. it worked for me, you need to check OmOperatingUnit related table(s).There must be one or more records in related table(s) which you need to
    delete manually.

    ReplyDelete