I'm trying to delete a business unit that is not the primary business unit of my CRM organization. It contains no users, teams, child business units, etc. It's empty. But I get this error message in the trace logs (among many others):
>Exception when executing non-query:
delete from [BusinessUnitBase]
OUTPUT DELETED.[BusinessUnitId], 10
into SubscriptionTrackingDeletedObject (ObjectId, ObjectTypeCode)
where ([BusinessUnitId] = '5f00e3a2-331d-459c-be18-e8ff78f5a0a1') Exception: System.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint "business_unit_socialactivity". The conflict occurred in database "Upward_Unlimited_MSCRM", table "dbo.ActivityPointerBase", column 'OwningBusinessUnit'.
The statement has been terminated.
It seems the system-managed relationship between Business Unit and Social Activity is just getting in the way! I haven't customized any of relationships with the business unit entity. Anybody ever run into this before?






