[SalesForce] Error in List View Unique Name when deploying to new org

I'm trying to create Ant tasks to make it easier to implement Continuous Integration in the company I work for, and I'm facing one annoying issue when trying to deploy the package to the new org.

  1. objects/Trabalho__c.object (Trabalho__c.Trabalhos_nao_concluidos_na_Sprint_Trabalho) — Error:
    This View Unique Name already exists or has been previously used.
    Please choose a different name. (line 1304, column 16)

I keep getting this error for lots of lists from this same object. I've already tried to edit the custom object, disabling the reports, activities and field history tracking. This solved another problem I had with the deploy for other object, but this error keeps appearing.

Salesforce keeps telling that the view already exists, but the new org is empty and doesn't have the object "Trabalho__c".

Is this a bug, or am I doing something wrong?

Best Answer

I figured out this was being caused by a sharing rule in the list view. The object affected had some views with the following tag:

<sharedTo>
        <allInternalUsers></allInternalUsers>
</sharedTo>

Interestingly, I removed those views, and could make the deploy.

I believe this is caused by a legacy feature that Salesforce tries to migrate to the new org. I had similar issues with profile permissions (some permissions don't exist in the newer orgs, but still do in the old ones).

Related Topic