# Delete org unit

**URL:** <https://community.dhis2.org/t/delete-org-unit/2430>\
**Category:** Support - Assistance technique\
**Created:** [17 January 2015 03:27 UTC](https://community.dhis2.org/t/delete-org-unit/2430 "2015-01-17T03:27:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pepe\_Ken\_Mvulu](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/pepe_ken_mvulu/32/29045_2.png) [@Pepe\_Ken\_Mvulu](https://community.dhis2.org/u/Pepe_Ken_Mvulu)\
**Post date:** [17 January 2015 03:27 UTC](https://community.dhis2.org/t/delete-org-unit/2430/1 "2015-01-17T03:27:42Z")

</div>

Hi all,

I’m quite new to dhis2, and still learning it. I’m using dhis v2.17.

I had created an organisation unit and have data entry.

How can I remove it directly in DHIS2 ?

I already delete all data in the dataset, but when I try to delete, I get the following message " **Objet not deleted because it associated by objects of type Datavalue"**

Is that possible ?

Best regards,

Pepe Ken

---

<div class="post-metadata">

**Author:** ![Joseph\_K\_Osborn](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/j/6a8cbe/32.png) [@Joseph\_K\_Osborn](https://community.dhis2.org/u/Joseph_K_Osborn)\
**Post date:** [17 January 2015 10:18 UTC](https://community.dhis2.org/t/delete-org-unit/2430/2 "2015-01-17T10:18:17Z")

</div>

Hi Pepe,

Let's me call you in your phone number or skype and try to help you.  
But notice there is a table named " Datavalue " who is associated with the organisation unit table.  
Let's do it in french my dear.

---

<div class="post-metadata">

**Author:** ![Pepe\_Ken\_Mvulu](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/pepe_ken_mvulu/32/29045_2.png) [@Pepe\_Ken\_Mvulu](https://community.dhis2.org/u/Pepe_Ken_Mvulu)\
**Post date:** [17 January 2015 11:54 UTC](https://community.dhis2.org/t/delete-org-unit/2430/3 "2015-01-17T11:54:19Z")

</div>

Hi all,  
Thank you very much my friends, I’ll try and I’ll let you know

Regards

Pepe Ken

> **···**
>
> 2015-01-17 11:18 GMT+01:00 Joseph K. Osborn [osbornlegrand@hotmail.fr](mailto:osbornlegrand@hotmail.fr):
> 
> > Hi Pepe,
> > 
> > Let’s me call you in your phone number or skype and try to help you.  
> > But notice there is a table named " **Datavalue "** who is associated with the organisation unit table.  
> > Let’s do it in french my dear.
> > 
> > * * *
> > 
> > Date: Sat, 17 Jan 2015 04:27:42 +0100  
> > From: [pepekento1@gmail.com](mailto:pepekento1@gmail.com)  
> > To: [dhis2-users@lists.launchpad.net](mailto:dhis2-users@lists.launchpad.net)  
> > Subject: [Dhis2-users] Delete org unit
> > 
> > Hi all,
> 
> > I’m quite new to dhis2, and still learning it. I’m using dhis v2.17.
> > 
> > I had created an organisation unit and have data entry.
> 
> > How can I remove it directly in DHIS2 ?
> 
> > I already delete all data in the dataset, but when I try to delete, I get the following message " **Objet not deleted because it associated by objects of type Datavalue"**
> 
> > Is that possible ?
> > 
> > Best regards,
> 
> > 
> 
> > Pepe Ken
> 
> > 
> 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Mailing list: [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)  
> > Post to : [dhis2-users@lists.launchpad.net](mailto:dhis2-users@lists.launchpad.net)  
> > Unsubscribe : [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)  
> > More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)

---

<div class="post-metadata">

**Author:** ![morten](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/morten/32/36295_2.png) [@morten](https://community.dhis2.org/u/morten)\
**Post date:** [17 January 2015 12:12 UTC](https://community.dhis2.org/t/delete-org-unit/2430/4 "2015-01-17T12:12:54Z")

</div>

I just want to reiterate on his point… there is a foreign key restraint on orgunit from the datavalue table

This means you need to delete any datavalue that references that ou before deleting it

> **···**
>
> 2015-01-17 11:18 GMT+01:00 Joseph K. Osborn [osbornlegrand@hotmail.fr](mailto:osbornlegrand@hotmail.fr):
> 
> > Hi Pepe,
> > 
> > Let’s me call you in your phone number or skype and try to help you.  
> > But notice there is a table named " **Datavalue "** who is associated with the organisation unit table.  
> > Let’s do it in french my dear.
> > 
> > * * *
> > 
> > Date: Sat, 17 Jan 2015 04:27:42 +0100  
> > From: [pepekento1@gmail.com](mailto:pepekento1@gmail.com)  
> > To: [dhis2-users@lists.launchpad.net](mailto:dhis2-users@lists.launchpad.net)  
> > Subject: [Dhis2-users] Delete org unit
> > 
> > Hi all,
> 
> > I’m quite new to dhis2, and still learning it. I’m using dhis v2.17.
> > 
> > I had created an organisation unit and have data entry.
> 
> > How can I remove it directly in DHIS2 ?
> 
> > I already delete all data in the dataset, but when I try to delete, I get the following message " **Objet not deleted because it associated by objects of type Datavalue"**
> 
> > Is that possible ?
> > 
> > Best regards,
> 
> > 
> 
> > Pepe Ken
> 
> > 
> 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Mailing list: [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)  
> > Post to : [dhis2-users@lists.launchpad.net](mailto:dhis2-users@lists.launchpad.net)  
> > Unsubscribe : [https://launchpad.net/~dhis2-users](https://launchpad.net/~dhis2-users)  
> > More help : [https://help.launchpad.net/ListHelp](https://help.launchpad.net/ListHelp)
