@@ -27,27 +27,99 @@ Custom tabs for navigating to objects, web content, or Visualforce pages within
2727## ⚙️ Required Properties
2828
2929### Core Tab Properties
30- - ** label** : Display name of the tab
31- - ** fullName** : API name of the object (for object tabs)
30+ - ** customObject** : ` true ` for custom object tabs, ` false ` for all others.
31+ - ** motif** : Tab icon style — choose a motif that semantically matches the object's purpose. Do NOT reuse the same motif for every tab.
32+ - ** label** : Display name (required for non-object tabs ONLY; object tabs inherit label from the object)
3233- ** url** : Web URL (for web tabs)
3334- ** page** : Visualforce page name (for Visualforce tabs)
3435
36+
37+ ### 🚨 STRICT ELEMENT ALLOWLIST — READ THIS FIRST
38+
39+ ** The root element MUST always be ` <CustomTab> ` (NOT ` <Tab> ` ).** The XML namespace must be ` xmlns="http://soap.sforce.com/2006/04/metadata" ` .
40+
41+ Only the elements listed below are valid. ** Any element not on this list WILL cause a deployment error.**
42+
43+ | Tab Type | ONLY these elements are allowed (nothing else) |
44+ | ---| ---|
45+ | ** Object tabs** | ` <customObject> ` (required, set to ` true ` ), ` <motif> ` (required), ` <description> ` (optional) |
46+ | ** Web tabs** | ` <customObject> ` (required, set to ` false ` ), ` <label> ` (required), ` <motif> ` (required), ` <url> ` (required), ` <urlEncodingKey> ` (required, set to ` UTF-8 ` ), ` <description> ` (optional), ` <frameHeight> ` (optional) |
47+ | ** Visualforce tabs** | ` <customObject> ` (required, set to ` false ` ), ` <label> ` (required), ` <motif> ` (required), ` <page> ` (required), ` <description> ` (optional) |
48+
49+ ### ⚠️ FORBIDDEN ELEMENTS (every one of these causes a deployment error)
50+ ` <sobjectName> ` , ` <name> ` , ` <fullName> ` , ` <apiVersion> ` , ` <isHidden> ` , ` <tabVisibility> ` , ` <type> ` , ` <mobileReady> ` , ` <urlFrameHeight> ` , ` <urlType> ` , ` <urlRedirect> ` , ` <encodingKey> ` , ` <height> ` , ` <auraComponent> `
51+
52+ Also forbidden:
53+ - ` <label> ` on object tabs (object tabs inherit their label from the custom object)
54+ - ` <page> ` on web tabs (only for Visualforce tabs)
55+ - Empty elements like ` <page></page> ` or ` <description></description> `
56+ - Any element not in the allowlist table above
57+
3558## 🔧 Tab Types
3659
3760### Object Tabs
3861- ** Purpose** : Navigate to custom or standard objects
39- - ** Required** : ` fullName ` property (set to object API name)
40- - ** Example** : ` <fullName>CustomObject__c</fullName> `
62+ - ** File name** determines the object: ` {ObjectApiName}.tab-meta.xml ` (e.g., ` Space_Station__c.tab-meta.xml ` )
63+ - ** Required elements** : ` <customObject>true</customObject> ` and ` <motif> `
64+ - ** Correct example** (for a Space_Station__ c.tab-meta.xml):
65+ ``` xml
66+ <?xml version =" 1.0" encoding =" UTF-8" ?>
67+ <CustomTab xmlns =" http://soap.sforce.com/2006/04/metadata" >
68+ <customObject >true</customObject >
69+ <motif >Custom39: Telescope</motif >
70+ </CustomTab >
71+ ```
72+ - ** Correct example** (for a Supply__ c.tab-meta.xml — note different motif):
73+ ``` xml
74+ <?xml version =" 1.0" encoding =" UTF-8" ?>
75+ <CustomTab xmlns =" http://soap.sforce.com/2006/04/metadata" >
76+ <customObject >true</customObject >
77+ <motif >Custom98: Truck</motif >
78+ </CustomTab >
79+ ```
80+ - ** ❌ WRONG** — do NOT add ` <sobjectName> ` , ` <name> ` , ` <fullName> ` , or ` <label> ` :
81+ ``` xml
82+ <CustomTab xmlns =" http://soap.sforce.com/2006/04/metadata" >
83+ <sobjectName >Space_Station__c</sobjectName > <!-- DEPLOYMENT ERROR -->
84+ <label >Space Station</label > <!-- DEPLOYMENT ERROR on object tabs -->
85+ <customObject >true</customObject >
86+ <motif >Custom57: Desert</motif >
87+ </CustomTab >
88+ ```
4189
4290### Web Tabs
4391- ** Purpose** : Link to external websites or web applications
44- - ** Required** : ` url ` property
45- - ** Example** : ` <url>https://example.com</url> `
92+ - ** File name** : Use a descriptive name: ` {TabName}.tab-meta.xml ` (e.g., ` Knowledge_Base.tab-meta.xml ` )
93+ - ** COPY THIS EXACT TEMPLATE** — only replace the placeholder values. Do NOT add, remove, or rename any XML elements:
94+ ``` xml
95+ <?xml version =" 1.0" encoding =" UTF-8" ?>
96+ <CustomTab xmlns =" http://soap.sforce.com/2006/04/metadata" >
97+ <customObject >false</customObject >
98+ <description >REPLACE_WITH_DESCRIPTION</description >
99+ <frameHeight >600</frameHeight >
100+ <label >REPLACE_WITH_LABEL</label >
101+ <motif >REPLACE_WITH_MOTIF</motif >
102+ <url >REPLACE_WITH_URL</url >
103+ <urlEncodingKey >UTF-8</urlEncodingKey >
104+ </CustomTab >
105+ ```
106+ - ** These 7 elements above are the ONLY elements allowed in a web tab file.** Do not add ANY other elements.
107+ - The ` <description> ` element is optional — you may remove it if not needed, but do not add anything else.
46108
47109### Visualforce Tabs
48110- ** Purpose** : Access custom Visualforce pages
49- - ** Required** : ` page ` property
50- - ** Example** : ` <page>CustomPage</page> `
111+ - ** File name** : ` {TabName}.tab-meta.xml ` (e.g., ` Custom_Page_Tab.tab-meta.xml ` )
112+ - ** Required elements** : ` <customObject>false</customObject> ` , ` <label> ` , ` <motif> ` , ` <page> `
113+ - ** Correct example** :
114+ ``` xml
115+ <?xml version =" 1.0" encoding =" UTF-8" ?>
116+ <CustomTab xmlns =" http://soap.sforce.com/2006/04/metadata" >
117+ <customObject >false</customObject >
118+ <label >Custom Page</label >
119+ <motif >Custom46: Computer</motif >
120+ <page >CustomPage</page >
121+ </CustomTab >
122+ ```
51123
52124## 🎨 Tab Configuration
53125
@@ -72,7 +144,11 @@ Custom tabs for navigating to objects, web content, or Visualforce pages within
72144## ✅ Best Practices
73145- Use clear, descriptive tab labels
74146- Choose appropriate tab types for functionality
147+ - ** Select a unique, contextually relevant motif for each tab** — do not default every tab to the same icon
75148- Consider user experience and navigation flow
76149- Test tab functionality across different applications
77150- Ensure proper permissions and visibility settings
78151- Follow consistent naming conventions
152+ - Object tab files MUST only contain ` <customObject>true</customObject> ` and ` <motif> ` — nothing else
153+ - Web tab files MUST only contain: ` <customObject>false</customObject> ` , ` <label> ` , ` <motif> ` , ` <url> ` , ` <urlEncodingKey> ` , and optionally ` <description> ` , ` <frameHeight> ` — nothing else
154+ - Never include ` <isHidden> ` , ` <tabVisibility> ` , ` <type> ` , ` <mobileReady> ` , or empty elements
0 commit comments