OBS-0244: This OBS Unit cannot be deleted because it is used either as default or override default value in an OBS attribute
search cancel

OBS-0244: This OBS Unit cannot be deleted because it is used either as default or override default value in an OBS attribute

book

Article ID: 374471

calendar_today

Updated On:

Products

Clarity PPM On Premise

Issue/Introduction

When trying to delete an OBS and you see the error

OBS-0244: This OBS Unit cannot be deleted because it is used either as default or override default value in an OBS attribute

and cannot delete the OBS. Where is the the default or override?

 

Resolution

First check for table:   SELECT * FROM ODF_DEFAULT_OVERRIDES

 - This table normally does not hold the record in question.

 

 

The Default or Override may be in a Studio either on an attribute or a View for a particular partition.

You will need the OBS Unit ID which you can get from the URL when you open the OBS Unit.

  - Click on the specific OBS Unit you want to delete and note the id in the URL.

            It will be similar to ...niku/nu#action:nmc.obsUnitProperties&id=5000007

The OBS ID in this example is 5000007

Then run these two queries and replace your ID   -Note these are Oracle sql queries.  They may need to be modified for other databases.

 

This first query checks to see if the actual custom attributes has a default. This should show which object and attribute has the obs.

select *
              from odf_custom_attributes custAttr, prj_obs_object_types obsTypes, prj_obs_units units, odf_objects obj
              where units.id = 5000007

               and   units.type_id = obsTypes.type_id and
                  obsTypes.assoc_att_code = custAttr.internal_name and
                  obj.code = custAttr.object_name and
                  obj.obs_code = obsTypes.table_name and
                  custAttr.extended_type in ('obs','obs_entity') and
                  (default_value = cast(units.type_id as varchar(10))||':'||cast(units.id as varchar(10)) or default_value = cast(units.id as varchar(10)))

 

This second query checks to see if there are views in studio with a default and/or override

 select *
              from odf_view_attributes viewAttr, prj_obs_object_types obsTypes, prj_obs_units units, odf_objects obj
              where units.id = 5000007

              and  units.type_id = obsTypes.type_id and
                  obsTypes.assoc_att_code = viewAttr.attribute_code and
                  obj.obs_code = obsTypes.table_name and
                  (viewAttr.default_value = cast(units.type_id as varchar(10))||':'||cast(units.id as varchar(10)) or viewAttr.default_value = cast(units.id as varchar(10)))

 

If results are returned for the odf_view_attributes, then use this query to see which partition and object the obs is defaulted on.

Query would be similar to

select * from odf_views where id (enter the view_ids) from the above query.