0

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

2
  • I assume this is a 1GP managed package packaging org you are discussing. To avoid strangeness with the Name on the TabDefinition, could you instead do SELECT 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?
    – Phil W
    Jun 22 at 15:25
  • @PhilW thank you for your time. Unfortunately, the result remains the same. I queried all the tabs created for custom SObjects, but a tab for Section is not returned(if it exists). Jun 23 at 10:40

0

You must log in to answer this question.

Browse other questions tagged .