@salesforce/afv-skills 1.28.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/dx-code-analyzer-configure/SKILL.md +31 -13
- package/skills/dx-code-analyzer-custom-rule-create/SKILL.md +484 -0
- package/skills/dx-code-analyzer-custom-rule-create/assets/pmd-ruleset-template.xml +31 -0
- package/skills/dx-code-analyzer-custom-rule-create/examples/metadata-xml-example-fields-api.md +87 -0
- package/skills/dx-code-analyzer-custom-rule-create/examples/metadata-xml-example-flows.md +105 -0
- package/skills/dx-code-analyzer-custom-rule-create/examples/metadata-xml-example-permissions.md +95 -0
- package/skills/dx-code-analyzer-custom-rule-create/examples/metadata-xml-examples.md +84 -0
- package/skills/dx-code-analyzer-custom-rule-create/examples/regex-examples.md +127 -0
- package/skills/dx-code-analyzer-custom-rule-create/examples/xpath-examples.md +227 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/advanced-pmd-patterns.md +288 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/apex-ast-reference.md +127 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/eslint-custom-plugins.md +247 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/eslint-rules-discovery.md +188 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/eslint-tier2-configurable.md +114 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/eslint-tier3-custom-plugins.md +113 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/metadata-xml-rules.md +285 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/regex-rule-schema.md +174 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/troubleshooting.md +141 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-governor-limits.md +83 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-method-calls.md +108 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-security.md +45 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-structure.md +127 -0
- package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns.md +131 -0
- package/skills/dx-code-analyzer-custom-rule-create/scripts/create-pmd-rule.js +209 -0
- package/skills/dx-code-analyzer-custom-rule-create/scripts/create-regex-rule.js +220 -0
- package/skills/dx-code-analyzer-run/SKILL.md +41 -8
- package/skills/mobile-platform-native-capabilities-integrate/SKILL.md +3 -3
- package/skills/platform-custom-field-generate/SKILL.md +86 -126
- package/skills/platform-custom-field-generate/references/advanced-picklists.md +590 -0
- package/skills/platform-value-set-generate/SKILL.md +305 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: platform-value-set-generate
|
|
3
|
+
description: "Use this skill when users need to create, generate, or validate a Salesforce global value set or customize a standard value set. Trigger when users mention a global value set, GlobalValueSet, standard value set, StandardValueSet, a reusable picklist, a picklist value set shared across fields, or customizing standard picklists like Industry, Lead Source, or Opportunity Stage. Also use when users hit deployment errors adding values to a standard picklist, referencing a value set from a custom field, or working with .globalValueSet-meta.xml or .standardValueSet-meta.xml files. DO NOT TRIGGER for an inline one-off picklist on a single field with no reuse, or for general custom field metadata work that does not involve a GlobalValueSet or StandardValueSet — use platform-custom-field-generate instead."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "60.0"
|
|
7
|
+
cliTools:
|
|
8
|
+
- tool: ["sf"]
|
|
9
|
+
semver: ">=2.0.0"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
Generates and validates the two reusable picklist value-set metadata types — **GlobalValueSet** (a new reusable set shared across fields) and **StandardValueSet** (customizing a built-in catalog picklist like Industry or Lead Source) — and wires a CustomField to one via `<valueSetName>`.
|
|
15
|
+
|
|
16
|
+
### Scope
|
|
17
|
+
|
|
18
|
+
- **In scope:** creating a GlobalValueSet, customizing a StandardValueSet, referencing either from a field, and the related deployment errors.
|
|
19
|
+
- **Out of scope:** a one-off inline picklist on a single field with no reuse → use **`platform-custom-field-generate`** (inline `<valueSetDefinition>`). Generating the *field* that references a value set is also `platform-custom-field-generate`'s job; this skill produces the value set itself.
|
|
20
|
+
|
|
21
|
+
**Two different metadata types — do not confuse them:**
|
|
22
|
+
|
|
23
|
+
| Concern | GlobalValueSet | StandardValueSet |
|
|
24
|
+
|---------|----------------|------------------|
|
|
25
|
+
| Folder | `globalValueSets/` | `standardValueSets/` |
|
|
26
|
+
| File suffix | `.globalValueSet-meta.xml` | `.standardValueSet-meta.xml` |
|
|
27
|
+
| Root element | `<GlobalValueSet>` | `<StandardValueSet>` |
|
|
28
|
+
| Name source | filename (dev name) | `<fullName>` = fixed catalog name |
|
|
29
|
+
| Value element | `<customValue>` | `<standardValue>` |
|
|
30
|
+
| Can add NEW values? | Yes | No — modify existing only |
|
|
31
|
+
| Can create a new NAME? | Yes | No — only the fixed catalog |
|
|
32
|
+
| `*` wildcard in package.xml | Supported | Not supported |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Specification
|
|
37
|
+
|
|
38
|
+
### 1. Purpose
|
|
39
|
+
|
|
40
|
+
This document defines the mandatory constraints for generating value-set metadata XML. The agent must verify these constraints before outputting XML to prevent Metadata API deployment errors.
|
|
41
|
+
|
|
42
|
+
- **GlobalValueSet** — a reusable, named set of picklist values defined once and referenced by any number of picklist/multi-select fields. Use when the same value list is shared across multiple fields.
|
|
43
|
+
- **StandardValueSet** — the value list behind a Salesforce-defined standard picklist (Industry, Lead Source, etc.). You can only **modify** the values in a fixed catalog of named sets; you cannot invent a new set or add brand-new values.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### 2. GlobalValueSet — Syntactic Essentials
|
|
48
|
+
|
|
49
|
+
**File:** `globalValueSets/<DeveloperName>.globalValueSet-meta.xml`
|
|
50
|
+
|
|
51
|
+
The developer name comes from the **filename**, not a `<fullName>` tag.
|
|
52
|
+
|
|
53
|
+
#### Required Elements
|
|
54
|
+
|
|
55
|
+
| Element | Requirement | Notes |
|
|
56
|
+
|---------|-------------|-------|
|
|
57
|
+
| `<masterLabel>` | Required | UI label for the value set |
|
|
58
|
+
| `<sorted>` | Required | `true` = alphabetize values in the UI; `false` = preserve listed order |
|
|
59
|
+
| `<customValue>` | Required (≥1) | One per value (see below) |
|
|
60
|
+
|
|
61
|
+
#### `<customValue>` Sub-Elements
|
|
62
|
+
|
|
63
|
+
| Sub-element | Requirement | Notes |
|
|
64
|
+
|-------------|-------------|-------|
|
|
65
|
+
| `<fullName>` | Required | The value's API name. Use the value text **as the user spelled it** — spaces are allowed and must be preserved (e.g. `Closed Won`, not `Closed_Won`). Must start with a letter. This is a value name, NOT a field API name, so do not append `__c` or replace spaces with underscores. |
|
|
66
|
+
| `<default>` | Optional | At most one value `true`. Omit it (or use `false`) on the rest — it is not required on every value. |
|
|
67
|
+
| `<label>` | Required | UI label for the value |
|
|
68
|
+
| `<color>` | Optional | Hex color, e.g. `#FF0000` |
|
|
69
|
+
| `<isActive>` | Optional | Omit (active) or `false` to deactivate |
|
|
70
|
+
| `<description>` | Optional | Per-value description |
|
|
71
|
+
|
|
72
|
+
#### The `__gvs` Suffix — do NOT use it in metadata
|
|
73
|
+
|
|
74
|
+
**Rule: reference a GlobalValueSet by its bare developer name. Never add `__gvs`.**
|
|
75
|
+
|
|
76
|
+
In API 57.0+ orgs the platform *stores/displays* a GlobalValueSet's developer name with a `__gvs` suffix internally, but the **Metadata API (deploy and retrieve) always uses the bare name** — `<valueSetName>Priority_Levels</valueSetName>`, not `Priority_Levels__gvs`. The suffix was briefly emitted by a Winter '23 change that caused deploy failures and was patched out. So:
|
|
77
|
+
|
|
78
|
+
- The file is `globalValueSets/Priority_Levels.globalValueSet-meta.xml` — **no `__gvs`** in the filename.
|
|
79
|
+
- A field references it as `<valueSetName>Priority_Levels</valueSetName>` — **no `__gvs`**.
|
|
80
|
+
- If a retrieve shows `Priority_Levels__gvs` in the org or you see a "returned from org but not found in local project" warning, that's the expected org-storage display — keep your local metadata on the bare name.
|
|
81
|
+
|
|
82
|
+
#### CORRECT — GlobalValueSet
|
|
83
|
+
|
|
84
|
+
```xml
|
|
85
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
86
|
+
<GlobalValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
87
|
+
<masterLabel>Priority Levels</masterLabel>
|
|
88
|
+
<sorted>false</sorted>
|
|
89
|
+
<customValue>
|
|
90
|
+
<fullName>Critical</fullName>
|
|
91
|
+
<default>false</default>
|
|
92
|
+
<label>Critical</label>
|
|
93
|
+
</customValue>
|
|
94
|
+
<customValue>
|
|
95
|
+
<fullName>High</fullName>
|
|
96
|
+
<default>false</default>
|
|
97
|
+
<label>High</label>
|
|
98
|
+
</customValue>
|
|
99
|
+
<customValue>
|
|
100
|
+
<fullName>Medium</fullName>
|
|
101
|
+
<default>true</default>
|
|
102
|
+
<label>Medium</label>
|
|
103
|
+
</customValue>
|
|
104
|
+
<customValue>
|
|
105
|
+
<fullName>Low</fullName>
|
|
106
|
+
<default>false</default>
|
|
107
|
+
<label>Low</label>
|
|
108
|
+
</customValue>
|
|
109
|
+
</GlobalValueSet>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### INCORRECT — GlobalValueSet
|
|
113
|
+
|
|
114
|
+
```xml
|
|
115
|
+
<GlobalValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
116
|
+
<fullName>Priority_Levels</fullName> <!-- WRONG: name comes from the filename -->
|
|
117
|
+
<masterLabel>Priority Levels</masterLabel>
|
|
118
|
+
<!-- WRONG: <sorted> is required and missing -->
|
|
119
|
+
<standardValue> <!-- WRONG: GVS uses <customValue>, not <standardValue> -->
|
|
120
|
+
<fullName>Critical</fullName>
|
|
121
|
+
</standardValue>
|
|
122
|
+
</GlobalValueSet>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Errors:** missing required `sorted`; unknown element `standardValue`; root `fullName` is rejected because the name is derived from the filename.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### 3. StandardValueSet — Syntactic Essentials CRITICAL
|
|
130
|
+
|
|
131
|
+
**File:** `standardValueSets/<Name>.standardValueSet-meta.xml`
|
|
132
|
+
|
|
133
|
+
#### HARD CONSTRAINTS — read before generating
|
|
134
|
+
|
|
135
|
+
1. **You can ONLY modify values inside the fixed catalog of named standard value sets.** You **cannot** add a brand-new value, and you **cannot** create a new StandardValueSet name. The Metadata API will reject both.
|
|
136
|
+
2. The root carries a `<fullName>` whose value is the **fixed enum name** (e.g. `Industry`), NOT a `masterLabel`. The filename must match this name.
|
|
137
|
+
3. Values are `<standardValue>` entries — **not** `<customValue>`.
|
|
138
|
+
4. **Emit ONLY the values the request explicitly names — a surgical, minimal change.** Include a `<standardValue>` block for each value the user asks you to activate, deactivate, relabel, or reorder, and **nothing else**. Do **not** enumerate the full picklist or emit `<standardValue>` entries for values the request did not mention. A StandardValueSet deployment is a partial update: unlisted values keep their current org state untouched. Reproducing every value (e.g. all 30+ Industry entries) is noise and risks clobbering org state — it is wrong even when the request says "keep *only* X active," which means "set the named ones; leave the rest as-is," not "enumerate and deactivate everything else." If you use the grounding MCP to discover existing values, use it only to confirm the named values exist and to get their exact `<fullName>`/`<label>` — not as a list to reproduce in full.
|
|
139
|
+
|
|
140
|
+
#### `<standardValue>` — Modifiable Sub-Elements
|
|
141
|
+
|
|
142
|
+
| Sub-element | Modifiable? | Notes |
|
|
143
|
+
|-------------|-------------|-------|
|
|
144
|
+
| `<fullName>` | Identifies the value (must already exist) | Cannot introduce a new one |
|
|
145
|
+
| `<label>` | Yes | Relabel the value's UI text |
|
|
146
|
+
| `<isActive>` | Yes | `false` deactivates; omit or `true` keeps active |
|
|
147
|
+
| `<default>` | Yes | At most one value `true` |
|
|
148
|
+
| `<groupingString>` | Yes | Category grouping (used by some standard picklists) |
|
|
149
|
+
|
|
150
|
+
#### Canonical StandardValueSet Names (partial)
|
|
151
|
+
|
|
152
|
+
`Industry`, `LeadSource`, `OpportunityStage`, `OpportunityType`, `AccountType`, `AccountRating`, `LeadStatus`, `CaseStatus`, `CaseOrigin`, `CasePriority`, `CaseReason`, `TaskStatus`, `TaskPriority`, `QuoteStatus`, `Product2Family`, `Salutation`, `AccountOwnership`, `ContractStatus`, `OrderStatus`, `PartnerRole`.
|
|
153
|
+
|
|
154
|
+
> Full appendix: the complete list of valid standard value set names is at
|
|
155
|
+
> `https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/standardvalueset_names.htm`.
|
|
156
|
+
> If the name is not in that appendix, it is **not** a StandardValueSet — it is either a GlobalValueSet or an inline CustomField picklist.
|
|
157
|
+
|
|
158
|
+
#### CORRECT — StandardValueSet (modify existing values only)
|
|
159
|
+
|
|
160
|
+
```xml
|
|
161
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
162
|
+
<StandardValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
163
|
+
<fullName>Industry</fullName>
|
|
164
|
+
<standardValue>
|
|
165
|
+
<fullName>Technology</fullName>
|
|
166
|
+
<default>false</default>
|
|
167
|
+
<label>Technology</label>
|
|
168
|
+
<isActive>true</isActive>
|
|
169
|
+
</standardValue>
|
|
170
|
+
<standardValue>
|
|
171
|
+
<fullName>Agriculture</fullName>
|
|
172
|
+
<default>false</default>
|
|
173
|
+
<label>Agriculture</label>
|
|
174
|
+
<isActive>false</isActive> <!-- deactivated, but kept in the set -->
|
|
175
|
+
</standardValue>
|
|
176
|
+
</StandardValueSet>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
#### INCORRECT — StandardValueSet
|
|
180
|
+
|
|
181
|
+
```xml
|
|
182
|
+
<StandardValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
183
|
+
<masterLabel>Industry</masterLabel> <!-- WRONG: StandardValueSet uses <fullName>, not masterLabel -->
|
|
184
|
+
<customValue> <!-- WRONG: uses <standardValue>, not customValue -->
|
|
185
|
+
<fullName>Renewable Energy</fullName> <!-- WRONG: cannot ADD a new value to a standard set -->
|
|
186
|
+
<label>Renewable Energy</label>
|
|
187
|
+
</customValue>
|
|
188
|
+
</StandardValueSet>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Errors:** unknown element `masterLabel`/`customValue`; adding a value not already in the standard catalog fails deployment.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
### 4. Never Invent Values — Verify, Don't Hallucinate CRITICAL
|
|
196
|
+
|
|
197
|
+
When customizing a **StandardValueSet** (or extending a shared GlobalValueSet), **only modify values that already exist** — never invent the value list of a standard picklist. The hard rule is about what you EMIT: a `<standardValue>` whose `<fullName>` is not a real catalog value will fail deployment.
|
|
198
|
+
|
|
199
|
+
For well-known standard picklists you already know the canonical values (e.g. `Industry`, `LeadSource`, `OpportunityStage`). When you are unsure a named value exists, you can confirm it against the live org — but treat lookup as a *confirmation* step, not a required first call:
|
|
200
|
+
|
|
201
|
+
- **Grounding MCP** (if available) exposes `search_metadata` and `query-metadata` to look up live metadata. Use them only to confirm a named value's exact `<fullName>`/`<label>` — not to pull the full list to reproduce.
|
|
202
|
+
- **CLI fallback** — query the Tooling API directly:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
sf data query --use-tooling-api \
|
|
206
|
+
--query "SELECT MasterLabel, Metadata FROM StandardValueSet WHERE MasterLabel = '<name>'"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
> **The point is the output, not the lookup:** emit modifications ONLY to values you know exist. A generated StandardValueSet that introduces unseen values is a hallucination and will fail deployment. (This pairs with the minimal-scope rule in §3: confirm the *named* values; don't enumerate the whole set.)
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
### 5. Referencing a Value Set from a CustomField
|
|
214
|
+
|
|
215
|
+
A picklist/multi-select CustomField references a value set via `<valueSetName>` inside `<valueSet>` (instead of an inline `<valueSetDefinition>`).
|
|
216
|
+
|
|
217
|
+
```xml
|
|
218
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
219
|
+
<fullName>Priority__c</fullName>
|
|
220
|
+
<label>Priority</label>
|
|
221
|
+
<type>Picklist</type>
|
|
222
|
+
<valueSet>
|
|
223
|
+
<restricted>true</restricted>
|
|
224
|
+
<valueSetName>Priority_Levels</valueSetName> <!-- bare developer name, NO __gvs; see §2 -->
|
|
225
|
+
</valueSet>
|
|
226
|
+
</CustomField>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
- For a **GlobalValueSet**, `<valueSetName>` is the **bare developer name** (e.g. `Priority_Levels`) — **never** add `__gvs`. The suffix is an org-storage display artifact; the Metadata API uses the bare name for both deploy and retrieve (see §2).
|
|
230
|
+
- A field bound to a value set must **not** also declare an inline `<valueSetDefinition>` — choose one or the other.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### 6. Validation Rules
|
|
235
|
+
|
|
236
|
+
The agent must **reject** and explain — not silently "fix" by inventing metadata — the following:
|
|
237
|
+
|
|
238
|
+
| Violation | Action / Message |
|
|
239
|
+
|-----------|------------------|
|
|
240
|
+
| Add a NEW value to a **StandardValueSet** | Reject. "Standard value sets cannot accept new values. Create a **GlobalValueSet** (reusable) or an inline picklist on a **CustomField** instead." |
|
|
241
|
+
| Create a NEW StandardValueSet name | Reject. The name must be in the standard catalog appendix. Otherwise it is a GlobalValueSet. |
|
|
242
|
+
| **Value set developer name** with spaces / invalid chars | Convert spaces to underscores; must start with a letter; alphanumeric + underscore only. `Priority Levels` → `Priority_Levels`. (This applies to the value SET name and the field API name — NOT to individual `<customValue><fullName>` values, which keep spaces as written.) |
|
|
243
|
+
| Duplicate value `fullName` within one set | Reject. Each `fullName` must be unique within the value set. |
|
|
244
|
+
| More than one `<default>true</default>` | Reject. At most one default value per set. |
|
|
245
|
+
|
|
246
|
+
#### INCORRECT — adding a value to a standard set
|
|
247
|
+
|
|
248
|
+
> "Add a `Cryptocurrency` value to the Industry picklist."
|
|
249
|
+
|
|
250
|
+
Do not emit a `<standardValue>` with `fullName` `Cryptocurrency`. Respond that standard value sets are a fixed catalog and propose a GlobalValueSet (if reused across fields) or an inline restricted picklist on a single CustomField.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
### 7. Deployment Ordering
|
|
255
|
+
|
|
256
|
+
A value set must deploy **before** any CustomField that references it.
|
|
257
|
+
|
|
258
|
+
- Deploy the `GlobalValueSet` / `StandardValueSet` first, then the CustomField whose `<valueSetName>` points at it.
|
|
259
|
+
- A field referencing a value set that does not yet exist fails with `valueSetName ... does not exist` (or a "not found" error).
|
|
260
|
+
- In `package.xml`: `GlobalValueSet` **supports** the `*` wildcard; `StandardValueSet` does **not** — list each standard set member explicitly.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
### 8. Common Deployment Errors
|
|
265
|
+
|
|
266
|
+
| Error / Symptom | Cause | Fix |
|
|
267
|
+
|-----------------|-------|-----|
|
|
268
|
+
| Value not added to standard picklist | Tried to ADD a value to a `StandardValueSet` | Standard sets are fixed; use GlobalValueSet or inline CustomField picklist |
|
|
269
|
+
| `Required field missing: sorted` | GlobalValueSet missing `<sorted>` | Add `<sorted>true</sorted>` or `<sorted>false</sorted>` |
|
|
270
|
+
| Unknown element `masterLabel` (StandardValueSet) | Used `masterLabel` instead of `fullName` | StandardValueSet root uses `<fullName>` = catalog name |
|
|
271
|
+
| Unknown element `customValue` (StandardValueSet) | Used `customValue` instead of `standardValue` | Use `<standardValue>` in standard sets |
|
|
272
|
+
| `valueSetName ... does not exist` | Field deployed before its value set, or `__gvs` wrongly added to the reference | Deploy the value set first; reference it by the **bare** developer name with NO `__gvs` (§2) |
|
|
273
|
+
| Duplicate value name | Two `<customValue>` entries share a `fullName` | Make each `fullName` unique within the set (spaces in a value name are allowed — do NOT underscore them) |
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Verification Checklist
|
|
278
|
+
|
|
279
|
+
Before generating value-set XML, verify:
|
|
280
|
+
|
|
281
|
+
### Type Selection
|
|
282
|
+
- [ ] Is this a reusable set shared across fields (GlobalValueSet) or a built-in standard picklist (StandardValueSet)?
|
|
283
|
+
- [ ] If StandardValueSet: is the name in the standard catalog appendix? If not, it must be a GlobalValueSet or inline picklist.
|
|
284
|
+
|
|
285
|
+
### GlobalValueSet Checks
|
|
286
|
+
- [ ] Is the root `<GlobalValueSet>` with namespace `http://soap.sforce.com/2006/04/metadata`?
|
|
287
|
+
- [ ] Is `<masterLabel>` present?
|
|
288
|
+
- [ ] Is `<sorted>` present (`true` or `false`)?
|
|
289
|
+
- [ ] Is there at least one `<customValue>`, each with `<fullName>` and `<label>` (at most one carrying `<default>true</default>`)?
|
|
290
|
+
- [ ] Is there NO root `<fullName>` (name comes from the filename)?
|
|
291
|
+
- [ ] When referencing from a field, is `<valueSetName>` the **bare** developer name with NO `__gvs` suffix?
|
|
292
|
+
|
|
293
|
+
### StandardValueSet Checks CRITICAL
|
|
294
|
+
- [ ] Are you emitting modifications ONLY to values you know exist (confirmed from known standard catalogs, or via grounding `search_metadata`/`query-metadata` / Tooling API if unsure) — never invented values?
|
|
295
|
+
- [ ] Is the root `<StandardValueSet>` with the correct namespace?
|
|
296
|
+
- [ ] Does the root use `<fullName>` set to the fixed catalog name (NOT `masterLabel`)?
|
|
297
|
+
- [ ] Are values `<standardValue>` entries (NOT `customValue`)?
|
|
298
|
+
- [ ] Are you ONLY modifying values that already exist (no new `fullName`)?
|
|
299
|
+
- [ ] Did you avoid adding a brand-new value or a new set name?
|
|
300
|
+
|
|
301
|
+
### Shared Checks
|
|
302
|
+
- [ ] At most one value has `<default>true</default>`?
|
|
303
|
+
- [ ] Are all value `fullName`s unique within the set? (Spaces in a value name are fine — preserve them as written; only the value-SET developer name and field API name use underscores.)
|
|
304
|
+
- [ ] Does the value set deploy BEFORE any CustomField that references it?
|
|
305
|
+
- [ ] Does the filename match the intended name?
|