@salesforce/afv-skills 1.65.1 → 1.67.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 +2 -4
- package/skills/agentforce-offline-experimentation-run/SKILL.md +29 -43
- package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +3 -245
- package/skills/commerce-react-storefront-create/SKILL.md +350 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/SKILL.md +2 -2
- package/skills/consumer-goods-promotion-bo-api-deploy/references/generate-and-wire.md +28 -16
- package/skills/consumer-goods-promotion-bo-api-deploy/references/smoke-and-verify.md +18 -1
- package/skills/dx-devops-work-item-manage/SKILL.md +34 -17
- package/skills/dx-devops-work-item-manage/examples/common-workflows.md +49 -0
- package/skills/dx-devops-work-item-manage/references/commit-api.md +116 -0
- package/skills/education-cloud-domain-configure/SKILL.md +21 -23
- package/skills/education-cloud-domain-configure/references/dependent-features.md +9 -0
- package/skills/education-cloud-domain-configure/references/domain-features.md +15 -0
- package/skills/education-cloud-domain-configure/references/gotchas-extended.md +8 -0
- package/skills/education-cloud-domain-configure/references/setup-widgets.md +123 -0
- package/skills/experience-lwc-widget-assess/SKILL.md +79 -0
- package/skills/experience-lwc-widget-migrate/SKILL.md +50 -0
- package/skills/experience-search-coordinate/SKILL.md +2 -2
- package/skills/experience-search-coordinate/references/media-route.md +30 -4
- package/skills/experience-ui-bundle-features-generate/SKILL.md +1 -1
- package/skills/experience-ui-bundle-mfa-configure/SKILL.md +1 -1
- package/skills/platform-metadata-deploy/README.md +1 -1
- package/skills/platform-metadata-deploy/SKILL.md +114 -15
- package/skills/platform-metadata-deploy/references/agent-deployment-guide.md +3 -4
- package/skills/platform-metadata-deploy/references/orchestration.md +2 -3
- package/skills/platform-role-hierarchy-apply/SKILL.md +177 -0
- package/skills/platform-value-set-generate/SKILL.md +19 -19
- package/skills/platform-widget-generate/SKILL.md +59 -68
- package/skills/platform-widget-generate/examples/formulas.json +19 -2
- package/skills/platform-widget-generate/examples/localized-labels.json +57 -0
- package/skills/platform-widget-generate/references/widget-actions.md +29 -0
- package/skills/platform-widget-generate/references/widget-bundle-validation.md +15 -0
- package/skills/platform-widget-generate/references/widget-formulas.md +24 -7
- package/skills/platform-widget-generate/references/widget-gotchas.md +10 -0
- package/skills/platform-widget-generate/references/widget-labels.md +78 -0
- package/skills/platform-widget-generate/references/widget-styling.md +12 -0
- package/skills/sales-call-scoring-configure/SKILL.md +17 -10
- package/skills/sales-call-scoring-configure/scripts/enable-call-scoring.sh +55 -33
- package/skills/service-agentforce-contact-center-coordinate/SKILL.md +1 -1
- package/skills/service-agentforce-contact-center-coordinate/references/number_management_api.md +11 -1
- package/skills/service-agentforce-contact-center-coordinate/scripts/fetch-numbers.sh +12 -6
- package/skills/service-agentforce-contact-center-coordinate/scripts/lib.sh +16 -0
- package/skills/service-agentforce-contact-center-coordinate/scripts/procure-number.sh +2 -1
- package/skills/service-concierge-portal-generate/references/portal-deploy-runbook.md +24 -11
- package/skills/service-digital-engagement-channel-configure/SKILL.md +29 -16
- package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +13 -2
- package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +143 -0
- package/skills/service-digital-engagement-deployment-configure/SKILL.md +65 -79
- package/skills/service-digital-engagement-deployment-configure/assets/esd_web_update_template.xml +83 -8
- package/skills/service-digital-engagement-deployment-configure/examples/esd_web_prechat_fields.xml +74 -0
- package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +26 -7
- package/skills/service-digital-engagement-deployment-configure/references/deployment_settings.md +13 -78
- package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +145 -0
- package/skills/service-digital-engagement-deployment-configure/references/prechat_forms.md +245 -0
- package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +166 -112
- package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +61 -37
- package/skills/service-itsm-agentic-setup-incident-management/references/audit-tracking.md +42 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/broadcast-communications.md +23 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/email-to-incident.md +23 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-dashboards.md +25 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-persona-psg.md +30 -145
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-preferences.md +32 -137
- package/skills/service-itsm-agentic-setup-incident-management/references/major-incident-management.md +32 -155
- package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +45 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +32 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/service-mgmt-privilege.md +30 -140
- package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +110 -0
- package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +34 -25
- package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +1 -1
- package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +90 -86
- package/skills/service-itsm-agentic-setup-incident-sla-configure/references/workflow.md +63 -38
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# Pre-Chat Forms Reference (`<embeddedServiceForms>`)
|
|
2
|
+
|
|
3
|
+
Complete reference for configuring pre-chat forms on an `EmbeddedServiceConfig`. Read this whenever the user asks to add, change, deactivate, or remove pre-chat fields, or to set `displayNameFormat`.
|
|
4
|
+
|
|
5
|
+
Collects information from users before conversation starts. Applicable to all deployment types.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Inputs to Gather
|
|
10
|
+
|
|
11
|
+
For each field:
|
|
12
|
+
- `formField`: a standard `_`-prefixed name, or the name of an existing channel `customParameter`.
|
|
13
|
+
- `formFieldType`.
|
|
14
|
+
- Whether it's required.
|
|
15
|
+
- Whether it's visible or hidden/pre-populated.
|
|
16
|
+
|
|
17
|
+
Also gather:
|
|
18
|
+
- **ChoiceList fields:** the DeveloperName of an existing `ChoiceList` (see [ChoiceList (Dropdown) Fields](#choicelist-dropdown-fields)).
|
|
19
|
+
- **`displayNameFormat`** (optional): see [displayNameFormat Rules](#displaynameformat-rules).
|
|
20
|
+
- **Omni-Flow routing details:** needed only if `isActive=true`, the channel isn't already Flow-routed, and the user accepts the offer to switch it (see [Runtime Dependency](#runtime-dependency-active-pre-chat-requires-omni-flow-routing)). Get the **Omni-Channel routing Flow API name** and the **fallback queue** DeveloperName. Both are needed to switch the channel to Flow routing, which is handed off to `service-digital-engagement-channel-configure`. Don't assume them.
|
|
21
|
+
- **Field → flow-variable mappings** (optional, and only meaningful with Omni-Flow routing): if the user wants the collected values delivered into the routing Flow, capture each pair (pre-chat field → flow input variable name). This skill does **not** write the mapping, because it lives on the channel. Pass the pairs to `service-digital-engagement-channel-configure`, which owns `actionParameterMappings`.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Defaults: Pre-Chat Is OFF Out of the Box
|
|
26
|
+
|
|
27
|
+
The Setup UI ships pre-chat **disabled**. A brand-new deployment has **no active form and no fields**. Match that baseline when the user gives no pre-chat instruction:
|
|
28
|
+
|
|
29
|
+
- **Do not generate an `<embeddedServiceForms>` block at all** unless the user explicitly asks for pre-chat data collection. Omitting it is the correct default.
|
|
30
|
+
- **Never auto-inject** `_FirstName` / `_LastName` / `_Email` / `_Subject` as "the default form." A starter set of standard fields is a common *admin* pattern, not a Salesforce-shipped default.
|
|
31
|
+
- When the user *does* ask for a form but omits per-field detail, mirror the Setup UI's unchecked checkboxes: `isRequired` → `false`, `isHidden` → `false`.
|
|
32
|
+
- `displayContext` has **no platform default** and is a required element. If the user doesn't specify, default to `Conversation`. This is a skill convention: the UI forces an explicit pick and there is no factory value.
|
|
33
|
+
|
|
34
|
+
## Form Structure
|
|
35
|
+
|
|
36
|
+
| Field | Type | Required | Default | Description |
|
|
37
|
+
|-------|------|----------|---------|-------------|
|
|
38
|
+
| `displayContext` | Enum | Yes | — (no platform default; skill uses `Conversation`) | `Conversation` (form shown every conversation) or `Session` (shown once per session) |
|
|
39
|
+
| `isActive` | Boolean | Yes | `false` | Whether the form is active. Platform default is `false`; set `true` to make the form live |
|
|
40
|
+
| `embeddedServiceFormFields` | Repeatable | Yes | — | Individual form fields (see below) |
|
|
41
|
+
|
|
42
|
+
## Form Field Structure (`<embeddedServiceFormFields>`)
|
|
43
|
+
|
|
44
|
+
| Field | Type | Required | Default | Description |
|
|
45
|
+
|-------|------|----------|---------|-------------|
|
|
46
|
+
| `displayOrder` | Integer | Yes | — | Display position. Visible fields use `0`-based ascending order; **hidden fields conventionally use `-1`** (see hidden-field pattern below) |
|
|
47
|
+
| `formField` | String | Yes | — | Parameter name. Use the `_` prefix for standard fields (e.g., `_FirstName`) and the exact `name` for custom fields. **Must resolve to a standard parameter or an existing `customParameter` on the associated channel** (see coupling note) |
|
|
48
|
+
| `formFieldType` | Enum | Yes | — | One of `Text`, `Email`, `Phone`, `Number`, `Checkbox`, `ChoiceList`. Setup UI "Field Type" labels match these, except `Dropdown` → `ChoiceList`. See the Custom Pre-Chat Fields section for the full UI mapping |
|
|
49
|
+
| `choiceList` | String | ChoiceList only | — | DeveloperName of an existing `ChoiceList` record. **Required when `formFieldType` is `ChoiceList`**; omit otherwise. The record must already exist in the org (not deployable — see ChoiceList section) |
|
|
50
|
+
| `isHidden` | Boolean | Yes | `false` | Whether field is hidden from the user (value still captured/pre-populated) |
|
|
51
|
+
| `isRequired` | Boolean | Yes | `false` | Whether field must be filled |
|
|
52
|
+
| `messagingChannelParameterType` | Enum | Yes | — | `Standard` or `Custom` |
|
|
53
|
+
|
|
54
|
+
Every attribute above is mandatory on each `<embeddedServiceFormFields>`, except `choiceList`. A missing attribute fails the deploy with "required field missing" or "upsert failed null".
|
|
55
|
+
|
|
56
|
+
## Hidden / Pre-Populated Fields
|
|
57
|
+
|
|
58
|
+
Hidden fields capture context without prompting the user, such as marketing attribution, campaign IDs, or tracking params. The value is passed through from the host page but never shown.
|
|
59
|
+
|
|
60
|
+
The Setup UI has no per-field "hidden" checkbox. Instead, a field is hidden by placing it under the **Hidden Pre-Chat Fields** accordion (rather than **Visible Pre-Chat Fields**) on the pre-chat panel. In metadata, that maps to:
|
|
61
|
+
|
|
62
|
+
- `isHidden` → `true`
|
|
63
|
+
- `displayOrder` → `-1`. Visible fields get sequential `0`-based order; hidden fields keep `-1` because they aren't ordered on-screen.
|
|
64
|
+
- `isRequired` → `false`
|
|
65
|
+
- `messagingChannelParameterType` → almost always `Custom` (must exist as a `customParameter` on the channel first)
|
|
66
|
+
|
|
67
|
+
```xml
|
|
68
|
+
<embeddedServiceFormFields>
|
|
69
|
+
<displayOrder>-1</displayOrder>
|
|
70
|
+
<formField>utm_campaign</formField>
|
|
71
|
+
<formFieldType>Text</formFieldType>
|
|
72
|
+
<isHidden>true</isHidden>
|
|
73
|
+
<isRequired>false</isRequired>
|
|
74
|
+
<messagingChannelParameterType>Custom</messagingChannelParameterType>
|
|
75
|
+
</embeddedServiceFormFields>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Field ↔ Channel Coupling (Required)
|
|
79
|
+
|
|
80
|
+
`formField` is validated against the associated messaging channel at deploy time:
|
|
81
|
+
|
|
82
|
+
- **Standard fields** (`_FirstName`, `_LastName`, `_Email`, `_Subject`) resolve to built-in standard parameters, so they have no channel prerequisite. The channel should still expose the matching `standardParameters` for routing.
|
|
83
|
+
- **Custom fields**, including every `ChoiceList` field, must match by name a `customParameter` already defined on the channel. Create those via `service-digital-engagement-channel-configure` **before** referencing them here, or the deploy fails.
|
|
84
|
+
|
|
85
|
+
## Runtime Dependency: Active Pre-Chat Requires Omni-Flow Routing
|
|
86
|
+
|
|
87
|
+
An **active** pre-chat form (`isActive=true`) only works on the client if the associated messaging channel's **routing type is Omni-Channel Flow ("Omni Flow")**:
|
|
88
|
+
|
|
89
|
+
- The routing Flow is what consumes the collected pre-chat parameters. With **queue-based routing the pre-chat form will not function**.
|
|
90
|
+
- Routing type is a channel-side setting owned by `service-digital-engagement-channel-configure`, not part of `EmbeddedServiceConfig`. It must still be true for the form to work.
|
|
91
|
+
|
|
92
|
+
The platform does not enforce this: Setup and the Metadata API both accept an active form on a queue-routed channel. How to handle it: gap 3 in [Validating and Remediating Prerequisites](#validating-and-remediating-prerequisites).
|
|
93
|
+
|
|
94
|
+
## Parameter → Flow-Variable Mapping (channel-side)
|
|
95
|
+
|
|
96
|
+
When the channel uses Omni-Flow routing, each pre-chat parameter can be bound to a routing-flow input variable so the collected value is delivered into the Flow.
|
|
97
|
+
|
|
98
|
+
**This binding lives on the `MessagingChannel`, not on the `EmbeddedServiceConfig`.** It is owned entirely by `service-digital-engagement-channel-configure`, which authors, documents, and validates it (see that skill's `channel_settings.md` for the `actionParameterMappings` shape). This skill never emits it.
|
|
99
|
+
|
|
100
|
+
This skill only captures the pairs (see Inputs to Gather) and passes them on in the hand-off below.
|
|
101
|
+
|
|
102
|
+
## Validating and Remediating Prerequisites
|
|
103
|
+
|
|
104
|
+
**Before generating the form**, validate it against the *retrieved* channel state. The gaps to check:
|
|
105
|
+
|
|
106
|
+
1. A custom `formField` with no matching channel `customParameter`: **blocks the deploy**.
|
|
107
|
+
2. A missing `ChoiceList` record: **blocks the deploy**.
|
|
108
|
+
3. `isActive=true` on a queue-routed channel: deploys, but the form won't work in the widget. **Warn only.**
|
|
109
|
+
|
|
110
|
+
For gaps 1 and 3, offer to fix them by **invoking `service-digital-engagement-channel-configure`**. Pass it the retrieved channel as context, plus any field → flow-variable pairs the user gave. This skill must never edit the `MessagingChannel` metadata itself.
|
|
111
|
+
|
|
112
|
+
A missing `ChoiceList` can only be created in Setup, so report it and don't create it. If gap 1 or 2 remains unfixed, stop and report the unmet prerequisite instead of emitting the form. For gap 3, emit the form either way and repeat the warning in the final summary.
|
|
113
|
+
|
|
114
|
+
Two cautions for the hand-off:
|
|
115
|
+
|
|
116
|
+
- **Hand off, don't hand-edit, and pass the existing channel as context.** `service-digital-engagement-channel-configure` builds a full channel document. Give it the retrieved channel so it *augments* the existing configuration; that's how existing `customParameters`, `actionParameterMappings`, consent, keywords, and settings avoid being clobbered. Do not merge channel XML by hand from within this skill.
|
|
117
|
+
- **The routing switch has prerequisites.** Moving a channel from Queue to Omni-Flow requires a fallback queue and an **already-existing** Omni-Channel routing Flow (create one via `automation-flow-generate` if none exists). It is a channel-wide change, so confirm the user intends it before handing off.
|
|
118
|
+
|
|
119
|
+
## Deactivating vs. Removing Pre-Chat Fields
|
|
120
|
+
|
|
121
|
+
Turning pre-chat off, or trimming fields, is not one operation, and the Metadata API update path does **not** behave like the Setup UI. The `<embeddedServiceFormFields>` collection follows a replace-if-present / no-op-if-empty rule. Pick the operation that matches the intent:
|
|
122
|
+
|
|
123
|
+
| Goal | How | Result |
|
|
124
|
+
|------|-----|--------|
|
|
125
|
+
| **Deactivate** (turn pre-chat off, keep fields) | Set `<isActive>false</isActive>`, deploy, **publish** | Form stops rendering; all fields are retained and can be reactivated. This is the off switch the Metadata API supports. |
|
|
126
|
+
| **Delete specific fields** | Deploy the block with **only the fields to KEEP** (min 1), then publish | A non-empty field collection is a full **replace**, so omitted fields are deleted. |
|
|
127
|
+
| **Delete ALL fields / delete the form** | **Not possible via Metadata API** | An empty collection (or omitting the block) is a silent **no-op**: the deploy reports "Succeeded" but every field is preserved. Removal is Setup-UI only (pre-chat editor link: ChoiceList rule 4). Even then a retrieve can still show an **inactive form with 1 field** (observed after a Setup delete), so don't promise the form is gone: offer to retrieve and report what remains. Deactivate instead. |
|
|
128
|
+
|
|
129
|
+
Key points:
|
|
130
|
+
|
|
131
|
+
- **Empty ≠ subset.** An *empty* `<embeddedServiceFormFields>` collection preserves everything (no-op), while a *non-empty* subset replaces the collection and drops the omitted fields. Through metadata you can shrink a form to 1 field, but never to 0.
|
|
132
|
+
- **Every case is a draft until published**, and publishing needs the user's approval (SKILL.md step 17c).
|
|
133
|
+
- **Order matters when a field maps to a custom channel param.** To remove a field bound to a channel `customParameter`:
|
|
134
|
+
1. Strip the field from the form and **republish**. This publish is required before the param can go, so ask the user to approve it; if they decline, stop before step 2.
|
|
135
|
+
2. Hand off to `service-digital-engagement-channel-configure` to delete the param. Other deployments can share the channel; any whose form still uses the param block the delete, so the channel skill checks them first.
|
|
136
|
+
|
|
137
|
+
Deleting a param that a live pre-chat field still references fails ("can't be deleted as it is referenced elsewhere"). The param's `actionParameterMapping` must also be removed first, which is a separate two-step change on the channel side.
|
|
138
|
+
- **Scalar footnote:** omitting the scalar `<displayNameFormat>` on a deploy *does* drop it. Scalars clear on omission, unlike the field collection.
|
|
139
|
+
|
|
140
|
+
## Example
|
|
141
|
+
|
|
142
|
+
See `examples/esd_web_prechat_fields.xml` for the full `<embeddedServiceForms>` + `<displayNameFormat>` delta (standard, custom, Checkbox, ChoiceList, and hidden fields). It is kept there as the single canonical copy rather than duplicated here. Graft it onto a base deployment such as `examples/esd_web_full.xml`.
|
|
143
|
+
|
|
144
|
+
## Standard Pre-Chat Fields
|
|
145
|
+
|
|
146
|
+
Standard fields use a `_` prefix in the `formField` value:
|
|
147
|
+
|
|
148
|
+
| `formField` Value | Maps to `parameterType` | Typical Usage |
|
|
149
|
+
|-------------------|------------------------|---------------|
|
|
150
|
+
| `_FirstName` | `FirstName` | User identification |
|
|
151
|
+
| `_LastName` | `LastName` | User identification |
|
|
152
|
+
| `_Email` | `Email` | Follow-up and case creation |
|
|
153
|
+
| `_Subject` | `Subject` | Routing context |
|
|
154
|
+
|
|
155
|
+
## Custom Pre-Chat Fields
|
|
156
|
+
|
|
157
|
+
Custom fields use the exact `name` value from the channel's `customParameters`, with no prefix (see Field ↔ Channel Coupling).
|
|
158
|
+
|
|
159
|
+
**Where the data type lives:** the channel `customParameter` is **always** `parameterDataType=String`; the channel accepts no other value. The field's actual data type (Text, Number, Checkbox, Dropdown) is set here at the deployment level, via `formFieldType`.
|
|
160
|
+
|
|
161
|
+
So a Checkbox pre-chat field is `formFieldType=Checkbox` on this ESD form field plus a plain `String` `customParameter` on the channel. Do **not** ask the channel skill for a `Boolean`/`Number` parameter; it fails with "bad value for restricted picklist field".
|
|
162
|
+
|
|
163
|
+
### How custom fields are created in the Setup UI
|
|
164
|
+
|
|
165
|
+
Admins add a custom field through **Setup → the pre-chat editor → Add Field**, which opens the **New Custom Field** dialog. This one dialog handles *all* custom field types. What it captures maps to metadata as follows:
|
|
166
|
+
|
|
167
|
+
| Setup UI field | Maps to | Notes |
|
|
168
|
+
|----------------|---------|-------|
|
|
169
|
+
| **Field Type** | `formFieldType` | Options → enum value: `Text`→`Text`, `Email`→`Email`, `Phone`→`Phone`, `Number`→`Number`, `Checkbox`→`Checkbox`, `Dropdown`→`ChoiceList` |
|
|
170
|
+
| **Channel Variable Name** | `formField` | A **lookup that selects an existing channel `customParameter`** (`MessagingChannelParameter`). It is *not* free text and does *not* create a parameter. If none exist, the dialog shows "Create one in Messaging Settings"; create it first via `service-digital-engagement-channel-configure` |
|
|
171
|
+
| Dropdown-only fields | see ChoiceList section | **Dropdown Name / Dropdown API Name / Dropdown API Values** appear only when Field Type is `Dropdown` |
|
|
172
|
+
|
|
173
|
+
Visible vs. hidden is **not** set in this dialog. It's determined by which accordion (Visible / Hidden Pre-Chat Fields) the field sits under on the main panel; see Hidden / Pre-Populated Fields above.
|
|
174
|
+
|
|
175
|
+
## ChoiceList (Dropdown) Fields
|
|
176
|
+
|
|
177
|
+
A ChoiceList renders the field as a dropdown of predefined options.
|
|
178
|
+
|
|
179
|
+
**Critical: a `ChoiceList` is NOT deployable metadata**; create it in Setup. There is no `.choiceList-meta.xml` file to author or `sf project deploy`. The `EmbeddedServiceConfig` only ever **references** a ChoiceList by its DeveloperName.
|
|
180
|
+
|
|
181
|
+
The dropdown (ChoiceList) is created **inline in the "New Custom Field" dialog** when Field Type is `Dropdown`. Saving that dialog creates the `ChoiceList` and `ChoiceListValue` records in the org; they are not part of the deployable `EmbeddedServiceConfig` artifact. The extra dialog fields map as:
|
|
182
|
+
|
|
183
|
+
| Setup UI field (Dropdown only) | Maps to | In `EmbeddedServiceConfig` XML? |
|
|
184
|
+
|--------------------------------|---------|-------------------------------|
|
|
185
|
+
| **Dropdown Name** | `ChoiceList.masterLabel` | No (org-side record) |
|
|
186
|
+
| **Dropdown API Name** | `ChoiceList.developerName` → the `<choiceList>` reference | Yes — `<choiceList>` value |
|
|
187
|
+
| **Dropdown API Values** | `ChoiceListValue` records | No (org-side records) |
|
|
188
|
+
|
|
189
|
+
Consequences for this skill:
|
|
190
|
+
|
|
191
|
+
1. **The ChoiceList must already exist in the target org**, created via the Dropdown dialog above. It is not part of the artifact this skill produces.
|
|
192
|
+
2. In the form field, set `formFieldType` to `ChoiceList` and add a `<choiceList>` element with the existing record's DeveloperName (= the Dropdown API Name).
|
|
193
|
+
3. The same field must also satisfy the **field ↔ channel coupling**: its `formField` must match an existing channel `customParameter` (the Channel Variable Name), and `messagingChannelParameterType` is `Custom`. Its channel param is `String`, like any custom field.
|
|
194
|
+
4. Before generating, confirm the ChoiceList exists. ChoiceList can't be queried through the data API or Tooling API, so don't run a query for it. Ask the user to confirm the dropdown exists in the Setup pre-chat editor (New Custom Field → Dropdown) and to give you its **Dropdown API Name**. If it doesn't exist **or the user isn't sure**, treat it as missing: leave the ChoiceList field out of every deploy (never deploy it to find out) and tell the user to create it in Setup first; do **not** attempt to generate or deploy a ChoiceList file. Give them a full, clickable link to the deployment's pre-chat editor: `<instanceUrl>/lightning/setup/EmbeddedServiceDeployments/<EmbeddedServiceConfigId>/EmbeddedMessaging/prechat`, where `instanceUrl` comes from `sf org display` and the Id from Tooling `SELECT Id FROM EmbeddedServiceConfig WHERE DeveloperName='<name>'`. Hand back only this plain URL; the user's own browser login opens it. Never paste `sf org open --url-only` output, because its frontdoor URL carries a login token. There they choose New Custom Field → Field Type `Dropdown`.
|
|
195
|
+
|
|
196
|
+
```xml
|
|
197
|
+
<embeddedServiceFormFields>
|
|
198
|
+
<choiceList>Customer_Inquiry_Type</choiceList>
|
|
199
|
+
<displayOrder>0</displayOrder>
|
|
200
|
+
<formField>InquiryType</formField>
|
|
201
|
+
<formFieldType>ChoiceList</formFieldType>
|
|
202
|
+
<isHidden>false</isHidden>
|
|
203
|
+
<isRequired>true</isRequired>
|
|
204
|
+
<messagingChannelParameterType>Custom</messagingChannelParameterType>
|
|
205
|
+
</embeddedServiceFormFields>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## displayNameFormat Rules
|
|
211
|
+
|
|
212
|
+
`displayNameFormat` is a scalar on `<embeddedServiceMessagingChannel>`. It sets the display name shown when pre-chat is enabled. Deploy and runtime both read the same field.
|
|
213
|
+
|
|
214
|
+
1. **Exactly 3 brace tokens:** `{a}{b}{c}`. Fewer fails structure validation (*"DisplayNameFormat field must match format {firstvalue}{secondvalue}{thirdvalue}"*). Leave unused slots **empty**, e.g. `{_firstName}{_lastName}{}`.
|
|
215
|
+
2. **Each non-empty token = the referenced pre-chat field's `externalParameterName`** (the "Channel Variable Name"), for *both* standard and custom fields. This is **not** the `<formField>` value:
|
|
216
|
+
- **Standard**: `_firstName`, `_lastName`, `_email`, `_subject` (lowercase-first). The `formField` apiValue spelling `{_FirstName}` is **rejected** (*"includes a field name that doesn't match any configured…pre-chat fields"*), because deploy validation and runtime both look up by `externalParameterName`.
|
|
217
|
+
- **Custom**: the channel `customParameter`'s `externalParameterName` (usually equal to its `name`, e.g. `CompanyName`).
|
|
218
|
+
3. At runtime each token is replaced by the value the user entered for that field, rendered space-separated (e.g. `Jane Doe`). Referenced parameters must be fields present (visible or hidden) in the form.
|
|
219
|
+
4. If you can't supply valid tokens, **omit** `displayNameFormat` (platform default).
|
|
220
|
+
5. **On a deployment that already has a form, tokens are checked against the *saved* fields, not the fields in the same deploy.** Adding a field and referencing it in `displayNameFormat` in one deploy fails with *"doesn't match any configured…pre-chat fields"*, even when the token is valid. Use two deploys: (1) the new field set, keeping the current `displayNameFormat`; (2) the same document with the new `displayNameFormat`. A deployment with no prior form accepts both in one deploy, but the two-step order is always safe.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Gotchas
|
|
225
|
+
|
|
226
|
+
| Issue | Resolution |
|
|
227
|
+
|-------|------------|
|
|
228
|
+
| Pre-chat ChoiceList not showing / missing | Created in Setup only; follow [ChoiceList rule 4](#choicelist-dropdown-fields) |
|
|
229
|
+
| Pre-chat form configured but not appearing / not working in the widget | Confirm `isActive=true` AND the channel uses Omni-Channel Flow routing (not queue-based). Active pre-chat only works with Omni-Flow routing. Also confirm the deployment was published after the deploy |
|
|
230
|
+
| Standard pre-chat field not found | Use `_` prefix for standard fields in `formField`: `_FirstName`, `_LastName`, `_Email`, `_Subject` |
|
|
231
|
+
| Custom pre-chat field fails to deploy | The `formField` must match an existing channel `customParameter` by name; add it via `service-digital-engagement-channel-configure` first |
|
|
232
|
+
| `displayNameFormat` rejected (bad format, or "field name doesn't match…pre-chat fields") | See [displayNameFormat Rules](#displaynameformat-rules): exactly 3 tokens, each a field's `externalParameterName` (`_firstName`, not `_FirstName`). If the token is correct but its field is new in the same deploy, deploy the field first, then the format (rule 5) |
|
|
233
|
+
| Deploy "Succeeded" but the pre-chat fields are all still there | An empty field collection is a no-op. Deactivate with `isActive=false`, or keep at least 1 field; removal is Setup-UI only (see the table above) |
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Verification Checklist
|
|
238
|
+
|
|
239
|
+
- [ ] Is `<embeddedServiceForms>` present only because the user asked for pre-chat?
|
|
240
|
+
- [ ] Does every `formField` resolve to a standard parameter (`_`-prefixed) or an **existing** channel `customParameter`?
|
|
241
|
+
- [ ] Do all `ChoiceList` fields reference a `<choiceList>` DeveloperName that already exists in the org?
|
|
242
|
+
- [ ] Do hidden/pre-populated fields use `displayOrder=-1` and `isHidden=true`?
|
|
243
|
+
- [ ] Does each `<embeddedServiceFormFields>` include all required attributes (`displayOrder`, `formField`, `formFieldType`, `isHidden`, `isRequired`, `messagingChannelParameterType`)?
|
|
244
|
+
- [ ] If `isActive=true` and the associated channel is not Omni-Channel Flow (Omni-Flow) routed, was the user warned that the form won't work in the widget until the routing is switched?
|
|
245
|
+
- [ ] If `displayNameFormat` is set, does it have **exactly 3** brace tokens (empties allowed)? Is each non-empty token a field's `externalParameterName` (lowercase-first `_firstName` etc., NOT `_FirstName`)?
|