I am not able to create a Custom Tab for a Custom SObject in my packaging org.
Name of the SObject: namespace__Section__c
When I try to create a new Custom Tab through Setup I see this message:
Duplicate Custom Object Definition The custom object is already assigned to a tab
There isn't such a tab visible in Setup or the App Launcher. When I query the custom tabs I see no tab for Section__c
List<TabDefinition> tabs = [SELECT Id, DurableId, Name, Label, SobjectName FROM TabDefinition
WHERE Name LIKE '%Section%'];
System.debug('Tabs for Section Sobject: ' + tabs.size());
for(TabDefinition t : tabs){
System.debug(JSON.serialize(t));
}
Result:
15:40:59:067 USER_DEBUG [2]|DEBUG|Tabs for Section Sobject: 0
Name
on theTabDefinition
, could you instead doSELECT Id, Name, Label, SobjectName FROM TabDefinition WHERE SobjectName = 'namespace__Section__c'
? Just wondering if that SObject was "renamed" at some point in the past and the tab name is different compared with the SObject's API name?