Hi Jhansi, You will also need to get rid of the data in the data value audit table.
Here is an SQL function which might work for you. https://github.com/dhis2/dhis2-utils/blob/master/resources/sql/delete_orgunit_with_data.sql Regards, Jason On Thu, Dec 14, 2017 at 2:49 PM, Jhansi Reddy Karee < jhans...@thoughtworks.com> wrote: > Hello Team, > > > In DHIS 2.27, we are not able to delete an organisation unit after > deleting all the data associated to it. > > > Following are the steps we have followed to do this: > > - > > Delete all the data associated to the organisation unit > - > > In Data administration app, under maintenance, we have performed > maintenance over “Permanently remove soft deleted data values”. > - > > Tried deleting the organisation unit. But, we are getting the > following error: Could not delete due to association with another object: > DataValueAudit > > > Please let us know if we have missed anything. > > > Thanks, > > Jhansi > > > > _______________________________________________ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-d...@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > > -- Jason P. Pickering email: jason.p.picker...@gmail.com tel:+46764147049
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-users Post to : dhis2-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-users More help : https://help.launchpad.net/ListHelp