Salesforce

WorldServer - when trying to delete a Cost Model, I receive the error 'Not all of the Cost Models were deleted. The following objects still have dependencies."

« Go Back

Information

 
Article TypeSolution Article
Scope/EnvironmentWorldServer
Symptoms/Context
I cannot delete one or more Cost Models, The message displayed is:

Not all of the Cost Models were deleted. The following objects still have dependencies.

User-added image
Resolution
Please verify that:
  1. The Cost Model is no longer used in any Project Type.  
  2. The Cost Model is no longer used in any or active or completed or canceled projects. To check this, enable the Cost Model column in your All active projects and All completed and canceled projects View and search for the Cost Model's name. If you find that it is associated with a project, remove the association through Change Attributes.
Sometimes it is not obvious to find out which projects prevent the Cost Model to be deleted. In that case, running this query in the Database will show the dependencies with projects:

select * from Projects where costModelId=xxxx

Note: The COSTMODELID can be found by clicking on the Cost Model name and check the URL. For instance:

https://worldserver.test.com/ws/management_costmodel?&token=1012946034&costmodel=2377

So assuming that the Cost Model ID is 2377, the query would be:

select * from Projects where costModelId=2377

The result of the query will display the active or completed/canceled projects associated with the Cost Model you would like to delete. If the Cost Model is associated with an active project, you can remove it via Change Attribute. However, if it is associated with a Completed or Canceled project that has not been archived yet, you will need to wait for the Project Cleaner to archive the project before you will be able to delete the Cost Model.
Root Cause
Reference
Attachment 1 
Attachment 2 
Attachment 3 
Attachment 4 
Attachment 5 

Powered by