@salesforce/afv-skills 1.31.0 → 1.32.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.
Files changed (98) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-bot-upgrade/SKILL.md +217 -0
  3. package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +242 -0
  4. package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +128 -0
  5. package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +208 -0
  6. package/skills/agentforce-bot-upgrade/references/input-contract.md +101 -0
  7. package/skills/agentforce-bot-upgrade/references/mapping-rules.md +113 -0
  8. package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +78 -0
  9. package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +67 -0
  10. package/skills/agentforce-bot-upgrade/references/quality-checklist.md +33 -0
  11. package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +116 -0
  12. package/skills/dx-devops-work-item-manage/SKILL.md +270 -0
  13. package/skills/dx-devops-work-item-manage/examples/common-workflows.md +479 -0
  14. package/skills/dx-devops-work-item-manage/references/cli-commands.md +476 -0
  15. package/skills/dx-org-manage/SKILL.md +8 -5
  16. package/skills/dx-org-trial-expiration-check/SKILL.md +239 -0
  17. package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +588 -0
  18. package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -9
  19. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +29 -5
  20. package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +1 -1
  21. package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +30 -0
  22. package/skills/experience-ui-bundle-features-generate/SKILL.md +86 -11
  23. package/skills/experience-ui-bundle-features-generate/references/conflict-resolution-schema.json +20 -0
  24. package/skills/experience-ui-bundle-features-generate/scripts/verify-react-bundle.sh +14 -0
  25. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +6 -1
  26. package/skills/experience-ui-bundle-frontend-generate/references/component.md +34 -1
  27. package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -1
  28. package/skills/experience-ui-bundle-project-generate/SKILL.md +111 -0
  29. package/skills/experience-ui-bundle-project-generate/scripts/flatten-project.mjs +33 -0
  30. package/skills/platform-custom-lightning-type-generate/SKILL.md +9 -14
  31. package/skills/platform-custom-lightning-type-generate/references/widget-rendition.md +27 -111
  32. package/skills/platform-lightning-type-widget-coordinate/SKILL.md +214 -0
  33. package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +80 -0
  34. package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +75 -0
  35. package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +67 -0
  36. package/skills/platform-lightning-type-widget-coordinate/references/lightning-type-discovery.md +124 -0
  37. package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +130 -0
  38. package/skills/platform-sharing-owd-configure/SKILL.md +142 -0
  39. package/skills/platform-sharing-owd-configure/examples/get_owd_output.md +38 -0
  40. package/skills/platform-sharing-owd-configure/examples/update_owd_output.md +44 -0
  41. package/skills/platform-sharing-owd-configure/references/access_levels.md +49 -0
  42. package/skills/platform-sharing-owd-configure/references/metadata_api_approach.md +69 -0
  43. package/skills/platform-sharing-rules-generate/SKILL.md +89 -19
  44. package/skills/platform-sharing-rules-generate/examples/test-cases.md +381 -0
  45. package/skills/platform-widget-generate/SKILL.md +241 -0
  46. package/skills/platform-widget-generate/examples/conditional.json +73 -0
  47. package/skills/platform-widget-generate/examples/list-with-foreach.json +66 -0
  48. package/skills/platform-widget-generate/examples/single-object.json +64 -0
  49. package/skills/platform-widget-generate/references/schema-from-lightning-type.md +76 -0
  50. package/skills/platform-widget-generate/references/widget-bundle-layout.md +116 -0
  51. package/skills/platform-widget-generate/references/widget-meta-directives.md +130 -0
  52. package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +268 -0
  53. package/skills/sales-agentforce-pipeline-management-configure/assets/field-completion-template.genAiPromptTemplate-meta.xml +141 -0
  54. package/skills/sales-agentforce-pipeline-management-configure/assets/pipeline_management_flow.flow-meta.xml +548 -0
  55. package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.agent +2938 -0
  56. package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.bundle-meta.xml +4 -0
  57. package/skills/sales-agentforce-pipeline-management-configure/assets/sfdx-project.json +12 -0
  58. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/bant.txt +11 -0
  59. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/meddic.txt +11 -0
  60. package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/spiced.txt +11 -0
  61. package/skills/sales-agentforce-pipeline-management-configure/examples/custom-prompt-instructions.md +317 -0
  62. package/skills/sales-agentforce-pipeline-management-configure/references/admin-communication.md +355 -0
  63. package/skills/sales-agentforce-pipeline-management-configure/references/agent-creation.md +383 -0
  64. package/skills/sales-agentforce-pipeline-management-configure/references/auth-and-cli.md +146 -0
  65. package/skills/sales-agentforce-pipeline-management-configure/references/automation-matrix.md +23 -0
  66. package/skills/sales-agentforce-pipeline-management-configure/references/autonomous-updates.md +215 -0
  67. package/skills/sales-agentforce-pipeline-management-configure/references/canonical-agent-path.md +75 -0
  68. package/skills/sales-agentforce-pipeline-management-configure/references/data-sources.md +155 -0
  69. package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompt-template.md +120 -0
  70. package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompts.md +149 -0
  71. package/skills/sales-agentforce-pipeline-management-configure/references/flags.md +13 -0
  72. package/skills/sales-agentforce-pipeline-management-configure/references/flow-clone-from-template.md +447 -0
  73. package/skills/sales-agentforce-pipeline-management-configure/references/metadata-inventory.md +330 -0
  74. package/skills/sales-agentforce-pipeline-management-configure/references/opportunity-stages.md +246 -0
  75. package/skills/sales-agentforce-pipeline-management-configure/references/repair-diagnostics.md +265 -0
  76. package/skills/sales-agentforce-pipeline-management-configure/references/setup-order.md +263 -0
  77. package/skills/sales-agentforce-pipeline-management-configure/references/soap-api-enablement.md +528 -0
  78. package/skills/sales-agentforce-pipeline-management-configure/scripts/CHANGES.md +180 -0
  79. package/skills/sales-agentforce-pipeline-management-configure/scripts/README.md +56 -0
  80. package/skills/sales-agentforce-pipeline-management-configure/scripts/add-field-suggestion.sh +679 -0
  81. package/skills/sales-agentforce-pipeline-management-configure/scripts/create-agent.sh +302 -0
  82. package/skills/sales-agentforce-pipeline-management-configure/scripts/create-flow.sh +250 -0
  83. package/skills/sales-agentforce-pipeline-management-configure/scripts/define-agent-access.sh +430 -0
  84. package/skills/sales-agentforce-pipeline-management-configure/scripts/deploy-settings.sh +77 -0
  85. package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-deal-agent.sh +241 -0
  86. package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-prerequisites.sh +538 -0
  87. package/skills/sales-agentforce-pipeline-management-configure/scripts/flow-debug-and-verify.sh +385 -0
  88. package/skills/sales-agentforce-pipeline-management-configure/scripts/retrieve-settings.sh +131 -0
  89. package/skills/sales-agentforce-pipeline-management-configure/scripts/setup-all.sh +2791 -0
  90. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-bundle-publish.sh +189 -0
  91. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-detection.sh +239 -0
  92. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/flow-builder.sh +238 -0
  93. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/psg.sh +48 -0
  94. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/soap.sh +140 -0
  95. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/stage-descriptions.sh +448 -0
  96. package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/test-opp.sh +166 -0
  97. package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-all.sh +636 -0
  98. package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-prompt-generation.sh +346 -0
@@ -0,0 +1,528 @@
1
+ # SOAP API Enablement Patterns
2
+
3
+ This reference provides verified working SOAP API calls for enabling all Pipeline Management prerequisites and the feature itself.
4
+
5
+ ## Why SOAP API Instead of CLI Metadata Deploy
6
+
7
+ **Problem:** CLI Metadata API deploy (`sf project deploy start`) has a **silent failure mode** with Settings metadata types:
8
+ - Deployment reports `success: true` and `changed: true`
9
+ - XML file shows intended values (e.g., `<enableDealAgent>true</enableDealAgent>`)
10
+ - But org silently reverts the setting to `false`
11
+ - Only discoverable via post-deployment verification queries
12
+
13
+ **Solution:** Use SOAP Metadata API `updateMetadata` operation directly. It bypasses the silent reversion issue.
14
+
15
+ **Evidence:** Tested in Enterprise Edition org with Agentforce for Sales add-on. All SOAP API calls succeeded; all CLI deploys silently failed.
16
+
17
+ ---
18
+
19
+ ## Pattern Template
20
+
21
+ All Settings metadata types follow this pattern:
22
+
23
+ ```bash
24
+ ORG_ALIAS="your-org"
25
+ AUTH_INFO=$(sf org display --target-org $ORG_ALIAS --json 2>/dev/null)
26
+ ACCESS_TOKEN=$(echo "$AUTH_INFO" | jq -r '.result.accessToken')
27
+ INSTANCE_URL=$(echo "$AUTH_INFO" | jq -r '.result.instanceUrl')
28
+ API_VERSION="<version>" # 62.0 for most, 64.0 for SalesDealAgent
29
+
30
+ curl -s "${INSTANCE_URL}/services/Soap/m/${API_VERSION}" \
31
+ -H "Content-Type: text/xml; charset=UTF-8" \
32
+ -H "SOAPAction: update" \
33
+ -d "<?xml version='1.0' encoding='utf-8'?>
34
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
35
+ <soapenv:Header>
36
+ <met:SessionHeader>
37
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
38
+ </met:SessionHeader>
39
+ </soapenv:Header>
40
+ <soapenv:Body>
41
+ <met:updateMetadata>
42
+ <met:metadata xsi:type='met:<SettingsType>' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
43
+ <met:fullName><SettingsName></met:fullName>
44
+ <met:<propertyName>><value></met:<propertyName>>
45
+ </met:metadata>
46
+ </met:updateMetadata>
47
+ </soapenv:Body>
48
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null
49
+ ```
50
+
51
+ **Key points:**
52
+ - `xsi:type` must match the metadata type exactly (case-sensitive)
53
+ - `fullName` is the Settings API name (not always the same as the type name)
54
+ - Property names must match the metadata structure (check Metadata API docs or retrieve first)
55
+ - Use `xmllint --format -` to pretty-print the response
56
+ - Always pipe `sf ... --json` through `2>/dev/null` before jq
57
+
58
+ ---
59
+
60
+ ## 1. Einstein Generative AI Platform
61
+
62
+ **Metadata Type:** `EinsteinGptSettings`
63
+ **API Version:** 62.0+
64
+ **Verification:** SOAP `readMetadata` for `EinsteinGptSettings` → check `<enableEinsteinGptPlatform>true</enableEinsteinGptPlatform>`
65
+ **Last resort UI:** Setup → Einstein → Einstein Generative AI → Einstein Setup → Turn on Einstein
66
+
67
+ ```bash
68
+ ORG_ALIAS="pipeline-mgmt-org"
69
+ AUTH_INFO=$(sf org display --target-org $ORG_ALIAS --json 2>/dev/null)
70
+ ACCESS_TOKEN=$(echo "$AUTH_INFO" | jq -r '.result.accessToken')
71
+ INSTANCE_URL=$(echo "$AUTH_INFO" | jq -r '.result.instanceUrl')
72
+
73
+ echo "=== Enabling Einstein Generative AI Platform ==="
74
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
75
+ -H "Content-Type: text/xml; charset=UTF-8" \
76
+ -H "SOAPAction: update" \
77
+ -d "<?xml version='1.0' encoding='utf-8'?>
78
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
79
+ <soapenv:Header>
80
+ <met:SessionHeader>
81
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
82
+ </met:SessionHeader>
83
+ </soapenv:Header>
84
+ <soapenv:Body>
85
+ <met:updateMetadata>
86
+ <met:metadata xsi:type='met:EinsteinGptSettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
87
+ <met:fullName>EinsteinGpt</met:fullName>
88
+ <met:enableEinsteinGptPlatform>true</met:enableEinsteinGptPlatform>
89
+ </met:metadata>
90
+ </met:updateMetadata>
91
+ </soapenv:Body>
92
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|fullName|message)" | head -5
93
+
94
+ echo -e "\n=== Verifying enablement (SOAP readMetadata) ==="
95
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
96
+ -H "Content-Type: text/xml; charset=UTF-8" \
97
+ -H "SOAPAction: readMetadata" \
98
+ -d "<?xml version='1.0' encoding='utf-8'?>
99
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
100
+ <soapenv:Header>
101
+ <met:SessionHeader>
102
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
103
+ </met:SessionHeader>
104
+ </soapenv:Header>
105
+ <soapenv:Body>
106
+ <met:readMetadata>
107
+ <met:type>EinsteinGptSettings</met:type>
108
+ <met:fullNames>EinsteinGpt</met:fullNames>
109
+ </met:readMetadata>
110
+ </soapenv:Body>
111
+ </soapenv:Envelope>" | grep -o "<enableEinsteinGptPlatform>[^<]*</enableEinsteinGptPlatform>"
112
+ # Expected: <enableEinsteinGptPlatform>true</enableEinsteinGptPlatform>
113
+ ```
114
+
115
+ ---
116
+
117
+ ## 2. Agentforce Agent
118
+
119
+ **Metadata Type:** `EinsteinCopilotSettings`
120
+ **API Version:** 62.0+
121
+ **Depends On:** Einstein Generative AI must be enabled first
122
+ **Verification:** SOAP `readMetadata` for `EinsteinCopilotSettings` → check `<enableEinsteinGptCopilot>true</enableEinsteinGptCopilot>`
123
+ **Last resort UI:** Setup → Einstein → Einstein Generative AI → Agentforce Studio → Agentforce Agents → Enable Agentforce
124
+
125
+ ```bash
126
+ echo "=== Enabling Agentforce Agent ==="
127
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
128
+ -H "Content-Type: text/xml; charset=UTF-8" \
129
+ -H "SOAPAction: update" \
130
+ -d "<?xml version='1.0' encoding='utf-8'?>
131
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
132
+ <soapenv:Header>
133
+ <met:SessionHeader>
134
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
135
+ </met:SessionHeader>
136
+ </soapenv:Header>
137
+ <soapenv:Body>
138
+ <met:updateMetadata>
139
+ <met:metadata xsi:type='met:EinsteinCopilotSettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
140
+ <met:fullName>EinsteinCopilot</met:fullName>
141
+ <met:enableEinsteinGptCopilot>true</met:enableEinsteinGptCopilot>
142
+ </met:metadata>
143
+ </met:updateMetadata>
144
+ </soapenv:Body>
145
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|fullName|message)" | head -5
146
+
147
+ echo -e "\n=== Verifying enablement ==="
148
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
149
+ -H "Content-Type: text/xml; charset=UTF-8" \
150
+ -H "SOAPAction: readMetadata" \
151
+ -d "<?xml version='1.0' encoding='utf-8'?>
152
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
153
+ <soapenv:Header>
154
+ <met:SessionHeader>
155
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
156
+ </met:SessionHeader>
157
+ </soapenv:Header>
158
+ <soapenv:Body>
159
+ <met:readMetadata>
160
+ <met:type>EinsteinCopilotSettings</met:type>
161
+ <met:fullNames>EinsteinCopilot</met:fullNames>
162
+ </met:readMetadata>
163
+ </soapenv:Body>
164
+ </soapenv:Envelope>" | grep -o "<enableEinsteinGptCopilot>[^<]*</enableEinsteinGptCopilot>"
165
+ # Expected: <enableEinsteinGptCopilot>true</enableEinsteinGptCopilot>
166
+ ```
167
+
168
+ **Note:** Do NOT enable `BotSettings` (`enableBots`) — that is for legacy messaging bots and is completely unrelated to Agentforce. It requires legal terms acceptance and will fail.
169
+
170
+ ---
171
+
172
+ ## 2b. Agentforce Studio (Agent Platform)
173
+
174
+ **Metadata Type:** `AgentPlatformSettings`
175
+ **API Version:** 62.0+
176
+ **Depends On:** Agentforce Agent (§2) must be enabled first
177
+ **Gates:** the Sales Deal Agent — core's `DealAgentEnabledOrgPreference` validates the Agentforce Platform preference (`AgentPlatformEnabled`) and rejects `SalesDealAgentSettings.enableDealAgent` when it is off, so a missing step here surfaces later as an opaque Deal Agent activation failure.
178
+ **Verification:** SOAP `readMetadata` for `AgentPlatformSettings` → check `<enableAgentPlatform>true</enableAgentPlatform>`
179
+ **Last resort UI:** Setup → Einstein → Agentforce Studio → Enable
180
+
181
+ ```bash
182
+ echo "=== Enabling Agentforce Studio (Agent Platform) ==="
183
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
184
+ -H "Content-Type: text/xml; charset=UTF-8" \
185
+ -H "SOAPAction: update" \
186
+ -d "<?xml version='1.0' encoding='utf-8'?>
187
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
188
+ <soapenv:Header>
189
+ <met:SessionHeader>
190
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
191
+ </met:SessionHeader>
192
+ </soapenv:Header>
193
+ <soapenv:Body>
194
+ <met:updateMetadata>
195
+ <met:metadata xsi:type='met:AgentPlatformSettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
196
+ <met:fullName>AgentPlatform</met:fullName>
197
+ <met:enableAgentPlatform>true</met:enableAgentPlatform>
198
+ </met:metadata>
199
+ </met:updateMetadata>
200
+ </soapenv:Body>
201
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|fullName|message)" | head -5
202
+
203
+ echo -e "\n=== Verifying enablement ==="
204
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
205
+ -H "Content-Type: text/xml; charset=UTF-8" \
206
+ -H "SOAPAction: readMetadata" \
207
+ -d "<?xml version='1.0' encoding='utf-8'?>
208
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
209
+ <soapenv:Header>
210
+ <met:SessionHeader>
211
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
212
+ </met:SessionHeader>
213
+ </soapenv:Header>
214
+ <soapenv:Body>
215
+ <met:readMetadata>
216
+ <met:type>AgentPlatformSettings</met:type>
217
+ <met:fullNames>AgentPlatform</met:fullNames>
218
+ </met:readMetadata>
219
+ </soapenv:Body>
220
+ </soapenv:Envelope>" | grep -o "<enableAgentPlatform>[^<]*</enableAgentPlatform>"
221
+ # Expected: <enableAgentPlatform>true</enableAgentPlatform>
222
+ ```
223
+
224
+ ---
225
+
226
+ ## 3. Enhanced Notes
227
+
228
+ **Metadata Type:** `EnhancedNotesSettings`
229
+ **API Version:** 62.0+
230
+ **Verification:** `SELECT count() FROM ContentNote` succeeds
231
+ **Last resort UI:** Setup → Feature Settings → Sales → Notes Settings → Enable Notes
232
+
233
+ ```bash
234
+ echo "=== Enabling Enhanced Notes ==="
235
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
236
+ -H "Content-Type: text/xml; charset=UTF-8" \
237
+ -H "SOAPAction: update" \
238
+ -d "<?xml version='1.0' encoding='utf-8'?>
239
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
240
+ <soapenv:Header>
241
+ <met:SessionHeader>
242
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
243
+ </met:SessionHeader>
244
+ </soapenv:Header>
245
+ <soapenv:Body>
246
+ <met:updateMetadata>
247
+ <met:metadata xsi:type='met:EnhancedNotesSettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
248
+ <met:fullName>EnhancedNotes</met:fullName>
249
+ <met:enableEnhancedNotes>true</met:enableEnhancedNotes>
250
+ </met:metadata>
251
+ </met:updateMetadata>
252
+ </soapenv:Body>
253
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|fullName|message)" | head -5
254
+
255
+ echo -e "\n=== Verifying enablement ==="
256
+ sf data query -q "SELECT count() FROM ContentNote" --target-org $ORG_ALIAS 2>/dev/null
257
+ # Expected: Total number of records (not "sObject type not supported")
258
+ ```
259
+
260
+ ---
261
+
262
+ ## 4. Enhanced Email
263
+
264
+ **Metadata Type:** `EmailAdministrationSettings`
265
+ **API Version:** 62.0+
266
+ **Purpose:** Enables email body indexing for Pipeline Management data sources
267
+ **Verification:** SOAP `readMetadata` for `EmailAdministrationSettings` → check `<enableEnhancedEmailEnabled>true</enableEnhancedEmailEnabled>`
268
+ **Last resort UI:** Setup → Feature Settings → Sales → Email Administration → Enable Enhanced Email
269
+
270
+ ```bash
271
+ echo "=== Enabling Enhanced Email ==="
272
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
273
+ -H "Content-Type: text/xml; charset=UTF-8" \
274
+ -H "SOAPAction: update" \
275
+ -d "<?xml version='1.0' encoding='utf-8'?>
276
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
277
+ <soapenv:Header>
278
+ <met:SessionHeader>
279
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
280
+ </met:SessionHeader>
281
+ </soapenv:Header>
282
+ <soapenv:Body>
283
+ <met:updateMetadata>
284
+ <met:metadata xsi:type='met:EmailAdministrationSettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
285
+ <met:fullName>EmailAdministration</met:fullName>
286
+ <met:enableEnhancedEmailEnabled>true</met:enableEnhancedEmailEnabled>
287
+ </met:metadata>
288
+ </met:updateMetadata>
289
+ </soapenv:Body>
290
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|fullName|message)" | head -5
291
+
292
+ echo -e "\n=== Verifying enablement ==="
293
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
294
+ -H "Content-Type: text/xml; charset=UTF-8" \
295
+ -H "SOAPAction: readMetadata" \
296
+ -d "<?xml version='1.0' encoding='utf-8'?>
297
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
298
+ <soapenv:Header>
299
+ <met:SessionHeader>
300
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
301
+ </met:SessionHeader>
302
+ </soapenv:Header>
303
+ <soapenv:Body>
304
+ <met:readMetadata>
305
+ <met:type>EmailAdministrationSettings</met:type>
306
+ <met:fullNames>EmailAdministration</met:fullNames>
307
+ </met:readMetadata>
308
+ </soapenv:Body>
309
+ </soapenv:Envelope>" | grep -o "<enableEnhancedEmailEnabled>[^<]*</enableEnhancedEmailEnabled>"
310
+ # Expected: <enableEnhancedEmailEnabled>true</enableEnhancedEmailEnabled>
311
+ ```
312
+
313
+ ---
314
+
315
+ ## 5. Opportunity Team Selling
316
+
317
+ **Metadata Type:** `OpportunitySettings`
318
+ **API Version:** 62.0+
319
+ **Prerequisite:** Opportunity Splitting must be disabled
320
+ **Verification:** `SELECT count() FROM OpportunityTeamMember` succeeds
321
+ **Last resort UI:** Setup → Feature Settings → Sales → Opportunities → Opportunity Team Settings → Enable Team Selling
322
+
323
+ ```bash
324
+ echo "=== Enabling Opportunity Team Selling ==="
325
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
326
+ -H "Content-Type: text/xml; charset=UTF-8" \
327
+ -H "SOAPAction: update" \
328
+ -d "<?xml version='1.0' encoding='utf-8'?>
329
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
330
+ <soapenv:Header>
331
+ <met:SessionHeader>
332
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
333
+ </met:SessionHeader>
334
+ </soapenv:Header>
335
+ <soapenv:Body>
336
+ <met:updateMetadata>
337
+ <met:metadata xsi:type='met:OpportunitySettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
338
+ <met:fullName>Opportunity</met:fullName>
339
+ <met:enableOpportunityTeam>true</met:enableOpportunityTeam>
340
+ </met:metadata>
341
+ </met:updateMetadata>
342
+ </soapenv:Body>
343
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|fullName|message)" | head -5
344
+
345
+ echo -e "\n=== Verifying enablement ==="
346
+ sf data query -q "SELECT count() FROM OpportunityTeamMember" --target-org $ORG_ALIAS 2>/dev/null
347
+ # Expected: Total number of records (not "sObject type not supported")
348
+ ```
349
+
350
+ **If error "Cannot enable both Opportunity Teams and Opportunity Splits":**
351
+ ```bash
352
+ # Disable Opportunity Splitting first
353
+ curl -s "${INSTANCE_URL}/services/Soap/m/62.0" \
354
+ -H "Content-Type: text/xml; charset=UTF-8" \
355
+ -H "SOAPAction: update" \
356
+ -d "<?xml version='1.0' encoding='utf-8'?>
357
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
358
+ <soapenv:Header>
359
+ <met:SessionHeader>
360
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
361
+ </met:SessionHeader>
362
+ </soapenv:Header>
363
+ <soapenv:Body>
364
+ <met:updateMetadata>
365
+ <met:metadata xsi:type='met:OpportunitySettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
366
+ <met:fullName>Opportunity</met:fullName>
367
+ <met:enableOpportunitySplit>false</met:enableOpportunitySplit>
368
+ </met:metadata>
369
+ </met:updateMetadata>
370
+ </soapenv:Body>
371
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|message)"
372
+
373
+ # Then retry enabling Opportunity Team Selling
374
+ ```
375
+
376
+ ---
377
+
378
+ ## 6. Pipeline Management
379
+
380
+ **Metadata Type:** `SalesDealAgentSettings`
381
+ **API Version:** 64.0+ (v62.0 returns "Property 'enableDealAgent' not valid")
382
+ **Verification:** SOAP `readMetadata` for `SalesDealAgentSettings` → check `<enableDealAgent>true</enableDealAgent>`
383
+ **Last resort UI:** Setup → Agentforce for Sales → Pipeline Management toggle
384
+
385
+ ```bash
386
+ echo "=== Enabling Pipeline Management ==="
387
+ curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
388
+ -H "Content-Type: text/xml; charset=UTF-8" \
389
+ -H "SOAPAction: update" \
390
+ -d "<?xml version='1.0' encoding='utf-8'?>
391
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
392
+ <soapenv:Header>
393
+ <met:SessionHeader>
394
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
395
+ </met:SessionHeader>
396
+ </soapenv:Header>
397
+ <soapenv:Body>
398
+ <met:updateMetadata>
399
+ <met:metadata xsi:type='met:SalesDealAgentSettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
400
+ <met:fullName>SalesDealAgent</met:fullName>
401
+ <met:enableDealAgent>true</met:enableDealAgent>
402
+ <met:enableDealAgentAutoApproveAllTasks>false</met:enableDealAgentAutoApproveAllTasks>
403
+ </met:metadata>
404
+ </met:updateMetadata>
405
+ </soapenv:Body>
406
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|fullName|message)" | head -5
407
+
408
+ echo -e "\n=== Verifying enablement ==="
409
+ curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
410
+ -H "Content-Type: text/xml; charset=UTF-8" \
411
+ -H "SOAPAction: readMetadata" \
412
+ -d "<?xml version='1.0' encoding='utf-8'?>
413
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
414
+ <soapenv:Header>
415
+ <met:SessionHeader>
416
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
417
+ </met:SessionHeader>
418
+ </soapenv:Header>
419
+ <soapenv:Body>
420
+ <met:readMetadata>
421
+ <met:type>SalesDealAgentSettings</met:type>
422
+ <met:fullNames>SalesDealAgent</met:fullNames>
423
+ </met:readMetadata>
424
+ </soapenv:Body>
425
+ </soapenv:Envelope>" | grep -o "<enableDealAgent>[^<]*</enableDealAgent>"
426
+ # Expected: <enableDealAgent>true</enableDealAgent>
427
+ ```
428
+
429
+ ---
430
+
431
+ ## 7. Pipeline Inspection
432
+
433
+ **Metadata Type:** `OpportunitySettings`
434
+ **API Version:** 64.0+
435
+ **Purpose:** Provides UI for sales reps to review and accept/dismiss agent suggestions
436
+ **Verification:** SOAP `readMetadata` for `OpportunitySettings` → check `<enablePipelineInspection>true</enablePipelineInspection>`
437
+ **Last resort UI:** Setup → Feature Settings → Sales → Opportunities → Pipeline Inspection
438
+
439
+ ```bash
440
+ echo "=== Enabling Pipeline Inspection ==="
441
+ curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
442
+ -H "Content-Type: text/xml; charset=UTF-8" \
443
+ -H "SOAPAction: update" \
444
+ -d "<?xml version='1.0' encoding='utf-8'?>
445
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
446
+ <soapenv:Header>
447
+ <met:SessionHeader>
448
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
449
+ </met:SessionHeader>
450
+ </soapenv:Header>
451
+ <soapenv:Body>
452
+ <met:updateMetadata>
453
+ <met:metadata xsi:type='met:OpportunitySettings' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
454
+ <met:fullName>Opportunity</met:fullName>
455
+ <met:enablePipelineInspection>true</met:enablePipelineInspection>
456
+ </met:metadata>
457
+ </met:updateMetadata>
458
+ </soapenv:Body>
459
+ </soapenv:Envelope>" | xmllint --format - 2>/dev/null | grep -E "(success|fullName|message)" | head -5
460
+
461
+ echo -e "\n=== Verifying enablement ==="
462
+ curl -s "${INSTANCE_URL}/services/Soap/m/64.0" \
463
+ -H "Content-Type: text/xml; charset=UTF-8" \
464
+ -H "SOAPAction: readMetadata" \
465
+ -d "<?xml version='1.0' encoding='utf-8'?>
466
+ <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:met='http://soap.sforce.com/2006/04/metadata'>
467
+ <soapenv:Header>
468
+ <met:SessionHeader>
469
+ <met:sessionId>${ACCESS_TOKEN}</met:sessionId>
470
+ </met:SessionHeader>
471
+ </soapenv:Header>
472
+ <soapenv:Body>
473
+ <met:readMetadata>
474
+ <met:type>OpportunitySettings</met:type>
475
+ <met:fullNames>Opportunity</met:fullNames>
476
+ </met:readMetadata>
477
+ </soapenv:Body>
478
+ </soapenv:Envelope>" | grep -o "<enablePipelineInspection>[^<]*</enablePipelineInspection>"
479
+ # Expected: <enablePipelineInspection>true</enablePipelineInspection>
480
+ ```
481
+
482
+ ---
483
+
484
+ ## Troubleshooting
485
+
486
+ ### SOAP API login disabled
487
+
488
+ If you see "SOAP API login() is disabled", use CLI metadata retrieve instead of raw SOAP calls:
489
+
490
+ ```bash
491
+ # Retrieve settings to check current values
492
+ sf project retrieve start --metadata "Settings:EinsteinGpt" --target-org $ORG_ALIAS 2>/dev/null
493
+ sf project retrieve start --metadata "Settings:EinsteinCopilot" --target-org $ORG_ALIAS 2>/dev/null
494
+ sf project retrieve start --metadata "Settings:EnhancedNotes" --target-org $ORG_ALIAS 2>/dev/null
495
+ sf project retrieve start --metadata "Settings:EmailAdministration" --target-org $ORG_ALIAS 2>/dev/null
496
+ sf project retrieve start --metadata "Settings:Opportunity" --target-org $ORG_ALIAS 2>/dev/null
497
+
498
+ # Check retrieved XML for <enable*>true</enable*> values
499
+ grep -r "enableEinsteinGptPlatform" force-app/
500
+ ```
501
+
502
+ The `sf` CLI uses its own OAuth mechanism internally, so it works even when SOAP API login is disabled.
503
+
504
+ ### Silent failure mode
505
+
506
+ If CLI deploy reports success but verification shows the setting is still disabled:
507
+ 1. Confirm you're using SOAP API `updateMetadata` (NOT `sf project deploy start`)
508
+ 2. Check API version (v64.0 for SalesDealAgent, v62.0 for others)
509
+ 3. Verify `xsi:type` matches the metadata type exactly
510
+ 4. Check for dependency violations (e.g., Agentforce Agent requires Einstein GenAI first)
511
+
512
+ ### Success but no change
513
+
514
+ If SOAP API returns `<success>true</success>` but setting doesn't change:
515
+ 1. Check for missing prerequisites (e.g., license, edition)
516
+ 2. Verify user has correct permissions
517
+ 3. Check for conflicting settings (e.g., Opportunity Splitting vs Team Selling)
518
+ 4. Look for error messages in SOAP response beyond `<success>` tag
519
+
520
+ ---
521
+
522
+ ## Notes
523
+
524
+ - Always pipe `sf ... --json` through `2>/dev/null` before jq (strips CLI warnings)
525
+ - Use `xmllint --format -` to pretty-print SOAP responses
526
+ - SOAP API is the ONLY reliable way to enable DealAgent settings
527
+ - CLI Metadata deploy WILL report success even when it fails
528
+ - Verify every enablement with a post-call check (SOAP readMetadata or SOQL)