@salesforce/afv-skills 1.50.0 → 1.52.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/experience-ui-bundle-deploy/SKILL.md +43 -2
- package/skills/experience-ui-bundle-deploy/references/config-scaffold.md +16 -3
- package/skills/experience-ui-bundle-deploy/references/logout-url.md +97 -0
- package/skills/experience-ui-bundle-deploy/scripts/set-logout-url.mjs +304 -0
- package/skills/experience-ui-bundle-localize/SKILL.md +107 -90
- package/skills/experience-ui-bundle-localize/references/angular/check-i18n-wired.sh +159 -0
- package/skills/experience-ui-bundle-localize/references/angular/i18n-setup.md +250 -0
- package/skills/experience-ui-bundle-localize/references/angular/interpolation.md +156 -0
- package/skills/experience-ui-bundle-localize/references/angular/localize.md +111 -0
- package/skills/experience-ui-bundle-localize/references/{gotchas.md → common/gotchas.md} +27 -43
- package/skills/experience-ui-bundle-localize/references/{label-xml.md → common/label-xml.md} +27 -17
- package/skills/experience-ui-bundle-localize/references/common/platform-sdk-i18n.md +169 -0
- package/skills/experience-ui-bundle-localize/references/{verifying.md → common/verifying.md} +26 -16
- package/skills/experience-ui-bundle-localize/{scripts → references/react}/check-i18n-wired.sh +8 -3
- package/skills/experience-ui-bundle-localize/references/{i18n-setup.md → react/i18n-setup.md} +48 -10
- package/skills/experience-ui-bundle-localize/references/{interpolation.md → react/interpolation.md} +4 -4
- package/skills/experience-ui-bundle-localize/references/react/localize.md +76 -0
- package/skills/experience-ui-bundle-localize/scripts/check-manifest-registered.sh +92 -24
- package/skills/experience-ui-bundle-localize/scripts/detect-framework.sh +73 -0
- package/skills/experience-ui-bundle-site-generate/SKILL.md +1 -1
- package/skills/field-service-data-capture-form-deployer-configure/SKILL.md +1 -1
- package/skills/field-service-data-capture-form-deployer-configure/references/flow-metadata-json.md +1 -1
- package/skills/field-service-data-capture-form-editor-configure/SKILL.md +1 -1
- package/skills/field-service-data-capture-reference-configure/SKILL.md +28 -15
- package/skills/field-service-foundation-setup-designer-get/SKILL.md +1 -1
- package/skills/field-service-mobile-branding-configure/SKILL.md +1 -1
- package/skills/field-service-objective-designer-configure/SKILL.md +381 -64
- package/skills/field-service-prework-brief-deployer-configure/SKILL.md +566 -3
- package/skills/field-service-scheduling-policy-designer-query/SKILL.md +1097 -57
- package/skills/field-service-sobject-create-configure/SKILL.md +222 -7
- package/skills/field-service-voice-to-form-configure/SKILL.md +11 -11
- package/skills/field-service-work-rule-designer-configure/SKILL.md +92 -107
- package/skills/service-digital-engagement-channel-configure/SKILL.md +20 -37
- package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +3 -2
- package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +4 -4
- package/skills/service-helpagent-coordinate/SKILL.md +37 -29
- package/skills/service-helpagent-coordinate/assets/help-agent-spec.md +33 -28
- package/skills/service-helpagent-coordinate/references/agent-script.md +4 -1
- package/skills/service-helpagent-coordinate/references/channel-voice.md +1 -1
- package/skills/service-helpagent-coordinate/references/channel-web-chat.md +10 -12
|
@@ -10,9 +10,17 @@ metadata:
|
|
|
10
10
|
semver: ">=2.0.0"
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
# Managing Fs Prework Brief Deployer
|
|
14
|
+
|
|
15
|
+
## When to Use This Skill
|
|
16
|
+
|
|
17
|
+
Deploy the deterministic half of Einstein Pre-Work Brief on Field Service Mobile to a target org via dispatch — prompt template, Lightning Data Service, licenses and permission sets, the Work Order layout field, and a scheduled test Work Order.
|
|
18
|
+
|
|
19
|
+
## Workflow
|
|
20
|
+
|
|
13
21
|
# Field Service Pre-Work Brief Deployer
|
|
14
22
|
|
|
15
|
-
**Deploy the deterministic half of Einstein Pre-Work Brief on Field Service Mobile via `
|
|
23
|
+
**Deploy the deterministic half of Einstein Pre-Work Brief on Field Service Mobile via `dispatch`.**
|
|
16
24
|
|
|
17
25
|
This skill takes an org whose Einstein for Field Service add-on is already provisioned and performs every automatable step to stand up Pre-Work Brief: it deploys three metadata artifacts, assigns licenses and permission sets, exposes the Work Order field on the technician's layout, wires a test Work Order scheduled in today's window, and **activates the prompt template via the Connect API**. The workflow is fully automatable end-to-end — there are no irreducibly manual steps. On-device rendering verification (confirming grounding produces job-specific content) is owned by the coordinating Pre-Work Brief skill, not this deploy primitive.
|
|
18
26
|
|
|
@@ -62,14 +70,14 @@ Every step is idempotent — it checks org state before it writes, so re-running
|
|
|
62
70
|
|
|
63
71
|
The template deploys **Published, not Active** — until it is activated it does not appear in the runtime catalog and the mobile app fails with *"We hit a snag."* Activation IS programmatic via the Connect API (available since v65.0 / API 258):
|
|
64
72
|
|
|
65
|
-
```
|
|
73
|
+
```text
|
|
66
74
|
PUT /services/data/v67.0/einstein/prompt-templates/{devName}/versions/{versionId}/status?action=activate&ignoreWarnings=false
|
|
67
75
|
Body: {}
|
|
68
76
|
```
|
|
69
77
|
|
|
70
78
|
- **Resolve the `versionId` first.** GET `/services/data/v67.0/einstein/prompt-templates/{devName}` and read `childRelationships.GenAiPromptTemplateVersions[].fields.Id.value` (the `3vN`-prefixed version Id). This GET works even while the template is inactive/absent from the catalog.
|
|
71
79
|
- On success the response is `isSuccessful:true`, `statusCode:"200"`, with an `additionalData.wrappedMap.summary.overallSeverity` of `SAFE`. The template-level `IsActive` flips to `true` and `ActiveVersionId` is populated (the version's own `Status` stays `Published` — "Published" at the version level *is* "Active" at the template level).
|
|
72
|
-
- **Not callable from Apex.** The endpoint is `@ConnectHidden(from=Apex)`; call it through `
|
|
80
|
+
- **Not callable from Apex.** The endpoint is `@ConnectHidden(from=Apex)`; call it through `dispatch` (or `sf api request rest --method PUT`), not `ConnectApi`. This is why the earlier Apex `ConnectApi.EinsteinLLM` and Tooling/metadata attempts failed — along with a wrong URL shape (`/activate` rather than `/versions/{id}/status?action=activate`) and too-early API versions (v62–v66).
|
|
73
81
|
- `verify-activation` — a runtime prompt-template-catalog read (`GET /einstein/prompt-templates?pageSize=200`, confirm `Pre_Work_Brief` now appears) — is chained immediately after to confirm activation landed.
|
|
74
82
|
|
|
75
83
|
*Live-verified against a non-prod org 2026-07-22: `IsActive` `False`→`True`, `ActiveVersionId` null→populated, and the template appeared in the runtime catalog on the same call.*
|
|
@@ -81,3 +89,558 @@ On-device verification (the technician opening the Field Service mobile app and
|
|
|
81
89
|
## Source
|
|
82
90
|
|
|
83
91
|
Authored from the sf-skills-internal coordinating skill `field-service-prework-brief-configure` (+ its `references/` files) and Salesforce Help for Einstein Pre-Work Brief. Live-validated against a dispatcher org. The harness derives the ordered, typed SOR from this skill on each run.
|
|
92
|
+
|
|
93
|
+
─────
|
|
94
|
+
**Runtime context (Headless 360 / agentic):** When this skill runs in the Headless 360 / agentic context, prefer the ``dispatch`` tool over CLI tools (``sf project deploy``, ``sfdx``, shell commands) when possible. The operations available to you are listed below in ``steps:``; each has been verified against the live org. Use ``dispatch`` against the canonical paths. CLI fallback is acceptable only when no API path exists for a given capability.
|
|
95
|
+
|
|
96
|
+
## Critical Constraints
|
|
97
|
+
|
|
98
|
+
**Preconditions:**
|
|
99
|
+
|
|
100
|
+
- EinsteinFieldServicePsl provisioned (check: `GET /services/data/v67.0/query?q=SELECT Id FROM PermissionSetLicense WHERE DeveloperName='EinsteinFieldServicePsl' returns totalSize>=1`)
|
|
101
|
+
- Admin holds Customize Application + Manage Profiles and Permission Sets (check: `session user is a Setup admin`)
|
|
102
|
+
- Einstein generative AI base setup complete (incl. Data 360 grounding) (check: `org-level Einstein Pref enabled; grounding sources reachable`)
|
|
103
|
+
- Pilot technician selected with an active ServiceResource (check: `GET /services/data/v67.0/query?q=SELECT Id, RelatedRecordId FROM ServiceResource WHERE IsActive=true AND RelatedRecordId='<pilot-user-id>' returns totalSize=1`)
|
|
104
|
+
|
|
105
|
+
## Verification Checklist
|
|
106
|
+
|
|
107
|
+
After every write operation, confirm the effect by re-reading state:
|
|
108
|
+
|
|
109
|
+
- After (write): call `verify-provisioning` (`GET /services/data/v67.0/query`)
|
|
110
|
+
- After `assign-perms-admin`: call `verify-permset-admin` (`GET /services/data/v67.0/query`)
|
|
111
|
+
- After `verify-showpreworkbrief-perm`: call `detect-existing-template` (`GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}`)
|
|
112
|
+
- After `deploy-prompt-template-header`: call `verify-template-deployed` (`GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}`)
|
|
113
|
+
- After `deploy-lds-setting`: call `verify-lds-enabled` (`GET /headless/invoke/platform/document-builder`)
|
|
114
|
+
- After `add-field-to-layout`: call `verify-field-on-layout` (`GET /services/data/v67.0/sobjects/WorkOrder/describe/layouts`)
|
|
115
|
+
- After `assign-resource`: call `verify-workorder-scheduled` (`GET /services/data/v67.0/query`)
|
|
116
|
+
- After `activate-prompt-template`: call `verify-activation` (`GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}`)
|
|
117
|
+
- After `assign-fs-einstein-user-admin`: call `verify-showpreworkbrief-perm` (`GET /services/data/v67.0/query`)
|
|
118
|
+
|
|
119
|
+
## Operations Reference
|
|
120
|
+
|
|
121
|
+
Operations grouped by purpose. Use these as the building blocks for the workflows above.
|
|
122
|
+
|
|
123
|
+
### Summary
|
|
124
|
+
|
|
125
|
+
| Operation | Purpose | Status | Call | Depends on |
|
|
126
|
+
|-----------|---------|--------|------|------------|
|
|
127
|
+
| `verify-provisioning` | verify | — | `GET /services/data/v67.0/query` | — |
|
|
128
|
+
| `assign-psl-admin` | write | — | `POST /services/data/v67.0/sobjects/PermissionSetLicenseAssign` | `verify-provisioning` |
|
|
129
|
+
| `assign-perms-admin` | write | — | `POST /services/data/v67.0/sobjects/PermissionSetAssignment` | `assign-psl-admin` |
|
|
130
|
+
| `verify-permset-admin` | verify | — | `GET /services/data/v67.0/query` | `assign-perms-admin` |
|
|
131
|
+
| `detect-existing-template` | verify | — | `GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}` | `verify-showpreworkbrief-perm` |
|
|
132
|
+
| `deploy-prompt-template-header` | write | — | `PATCH /headless/invoke/platform/einstein-prompt-studio/insert-prompt-template` | `detect-existing-template` |
|
|
133
|
+
| `verify-template-deployed` | verify | — | `GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}` | `deploy-prompt-template-header` |
|
|
134
|
+
| `read-fieldservice-settings` | read | — | `GET /headless/invoke/platform/document-builder` | `verify-template-deployed` |
|
|
135
|
+
| `deploy-lds-setting` | write | — | `PATCH /headless/invoke/platform/document-builder-rlm/save-field-service-settings-config` | `read-fieldservice-settings` |
|
|
136
|
+
| `verify-lds-enabled` | verify | — | `GET /headless/invoke/platform/document-builder` | `deploy-lds-setting` |
|
|
137
|
+
| `deploy-field-access-permset` | write | — | `POST /services/data/v67.0/sobjects/PermissionSet` | `verify-lds-enabled` |
|
|
138
|
+
| `assign-perms-technician` | write | — | `POST /services/data/v67.0/sobjects/PermissionSetAssignment` | `deploy-field-access-permset` |
|
|
139
|
+
| `read-workorder-layout` | read | — | `GET /services/data/v67.0/sobjects/WorkOrder/describe/layouts` | `assign-perms-technician` |
|
|
140
|
+
| `verify-field-on-layout` | verify | — | `GET /services/data/v67.0/sobjects/WorkOrder/describe/layouts` | `add-field-to-layout` |
|
|
141
|
+
| `create-test-workorder` | write | — | `POST /services/data/v67.0/sobjects/WorkOrder` | `verify-field-on-layout` |
|
|
142
|
+
| `create-service-appointment` | write | — | `POST /services/data/v67.0/sobjects/ServiceAppointment` | `create-test-workorder` |
|
|
143
|
+
| `assign-resource` | write | — | `POST /services/data/v67.0/sobjects/AssignedResource` | `create-service-appointment` |
|
|
144
|
+
| `verify-workorder-scheduled` | verify | — | `GET /services/data/v67.0/query` | `assign-resource` |
|
|
145
|
+
| `point-existing-workorder` | write | — | `PATCH /services/data/v67.0/sobjects/WorkOrder/{Id}` | `verify-field-on-layout` |
|
|
146
|
+
| `resolve-template-version` | read | — | `GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}` | `verify-workorder-scheduled`, `point-existing-workorder` |
|
|
147
|
+
| `activate-prompt-template` | write | — | `PUT /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}/status?action=activate&ignoreWarnings=false` | `resolve-template-version` |
|
|
148
|
+
| `verify-activation` | verify | — | `GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}` | `activate-prompt-template` |
|
|
149
|
+
| `assign-fs-einstein-psl-admin` | write | — | `POST /services/data/v67.0/sobjects/PermissionSetLicenseAssign` | `verify-permset-admin` |
|
|
150
|
+
| `assign-fs-einstein-user-admin` | write | — | `POST /services/data/v67.0/sobjects/PermissionSetAssignment` | `assign-fs-einstein-psl-admin` |
|
|
151
|
+
| `verify-showpreworkbrief-perm` | verify | — | `GET /services/data/v67.0/query` | `assign-fs-einstein-user-admin` |
|
|
152
|
+
| `add-field-to-layout` | write | — | `PATCH /services/data/v67.0/tooling/sobjects/Layout/{layoutId}` | `read-workorder-layout` |
|
|
153
|
+
|
|
154
|
+
### Dependency graph
|
|
155
|
+
|
|
156
|
+
```mermaid
|
|
157
|
+
graph TD
|
|
158
|
+
verify_provisioning["verify-provisioning (verify)"]
|
|
159
|
+
assign_psl_admin["assign-psl-admin (write)"]
|
|
160
|
+
assign_perms_admin["assign-perms-admin (write)"]
|
|
161
|
+
verify_permset_admin["verify-permset-admin (verify)"]
|
|
162
|
+
detect_existing_template["detect-existing-template (verify)"]
|
|
163
|
+
deploy_prompt_template_header["deploy-prompt-template-header (write)"]
|
|
164
|
+
verify_template_deployed["verify-template-deployed (verify)"]
|
|
165
|
+
read_fieldservice_settings["read-fieldservice-settings (read)"]
|
|
166
|
+
deploy_lds_setting["deploy-lds-setting (write)"]
|
|
167
|
+
verify_lds_enabled["verify-lds-enabled (verify)"]
|
|
168
|
+
deploy_field_access_permset["deploy-field-access-permset (write)"]
|
|
169
|
+
assign_perms_technician["assign-perms-technician (write)"]
|
|
170
|
+
read_workorder_layout["read-workorder-layout (read)"]
|
|
171
|
+
verify_field_on_layout["verify-field-on-layout (verify)"]
|
|
172
|
+
create_test_workorder["create-test-workorder (write)"]
|
|
173
|
+
create_service_appointment["create-service-appointment (write)"]
|
|
174
|
+
assign_resource["assign-resource (write)"]
|
|
175
|
+
verify_workorder_scheduled["verify-workorder-scheduled (verify)"]
|
|
176
|
+
point_existing_workorder["point-existing-workorder (write)"]
|
|
177
|
+
resolve_template_version["resolve-template-version (read)"]
|
|
178
|
+
activate_prompt_template["activate-prompt-template (write)"]
|
|
179
|
+
verify_activation["verify-activation (verify)"]
|
|
180
|
+
assign_fs_einstein_psl_admin["assign-fs-einstein-psl-admin (write)"]
|
|
181
|
+
assign_fs_einstein_user_admin["assign-fs-einstein-user-admin (write)"]
|
|
182
|
+
verify_showpreworkbrief_perm["verify-showpreworkbrief-perm (verify)"]
|
|
183
|
+
add_field_to_layout["add-field-to-layout (write)"]
|
|
184
|
+
verify_provisioning --> assign_psl_admin
|
|
185
|
+
assign_psl_admin --> assign_perms_admin
|
|
186
|
+
assign_perms_admin --> verify_permset_admin
|
|
187
|
+
verify_showpreworkbrief_perm --> detect_existing_template
|
|
188
|
+
detect_existing_template --> deploy_prompt_template_header
|
|
189
|
+
deploy_prompt_template_header --> verify_template_deployed
|
|
190
|
+
verify_template_deployed --> read_fieldservice_settings
|
|
191
|
+
read_fieldservice_settings --> deploy_lds_setting
|
|
192
|
+
deploy_lds_setting --> verify_lds_enabled
|
|
193
|
+
verify_lds_enabled --> deploy_field_access_permset
|
|
194
|
+
deploy_field_access_permset --> assign_perms_technician
|
|
195
|
+
assign_perms_technician --> read_workorder_layout
|
|
196
|
+
add_field_to_layout --> verify_field_on_layout
|
|
197
|
+
verify_field_on_layout --> create_test_workorder
|
|
198
|
+
create_test_workorder --> create_service_appointment
|
|
199
|
+
create_service_appointment --> assign_resource
|
|
200
|
+
assign_resource --> verify_workorder_scheduled
|
|
201
|
+
verify_field_on_layout --> point_existing_workorder
|
|
202
|
+
verify_workorder_scheduled --> resolve_template_version
|
|
203
|
+
point_existing_workorder --> resolve_template_version
|
|
204
|
+
resolve_template_version --> activate_prompt_template
|
|
205
|
+
activate_prompt_template --> verify_activation
|
|
206
|
+
verify_permset_admin --> assign_fs_einstein_psl_admin
|
|
207
|
+
assign_fs_einstein_psl_admin --> assign_fs_einstein_user_admin
|
|
208
|
+
assign_fs_einstein_user_admin --> verify_showpreworkbrief_perm
|
|
209
|
+
read_workorder_layout --> add_field_to_layout
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Read operations
|
|
213
|
+
|
|
214
|
+
#### `read-fieldservice-settings`
|
|
215
|
+
|
|
216
|
+
Read the Field Service settings singleton (userSettings map — lsdkForFieldServiceMobilePref for LDS on mobile, other prefs). Result is the pre-write snapshot for deploy-lds-setting's read-back contract in verify-lds-enabled. Reused from FieldServiceSettings SOR.
|
|
217
|
+
|
|
218
|
+
**Call:** `GET /headless/invoke/platform/document-builder`
|
|
219
|
+
|
|
220
|
+
**Depends on:** `verify-template-deployed`
|
|
221
|
+
|
|
222
|
+
**Output:** FieldServiceSettingsSerializer map at body.body. Load-bearing key: lsdkForFieldServiceMobilePref (Lightning Data Service for Field Service Mobile — without it, Pre-Work Brief renders blank on device). This step is a snapshot for verify-lds-enabled; deploy-lds-setting does NOT consume the full map (see its inputs — the controller uses isChanged<Field> partial-patch semantics).
|
|
223
|
+
|
|
224
|
+
#### `read-workorder-layout`
|
|
225
|
+
|
|
226
|
+
Enumerate WorkOrder page layouts + record types. Result feeds add-field-to-layout / verify-field-on-layout. Response is large (~200KB).
|
|
227
|
+
|
|
228
|
+
**Call:** `GET /services/data/v67.0/sobjects/WorkOrder/describe/layouts`
|
|
229
|
+
|
|
230
|
+
**Depends on:** `assign-perms-technician`
|
|
231
|
+
|
|
232
|
+
**Output:** layouts[] array with layoutSections/detailLayoutSections and buttonLayoutSection; recordTypeMappings[] mapping recordTypeId -> layoutId. Scan detailLayoutSections[].layoutRows[].layoutItems[].layoutComponents[].value for the technician's layout to check whether 'PreWorkBriefPromptTemplate' is present.
|
|
233
|
+
|
|
234
|
+
#### `resolve-template-version`
|
|
235
|
+
|
|
236
|
+
Extract the 3vN-prefix version Id from the deployed Pre_Work_Brief template. Same GET as detect-existing-template / verify-template-deployed — this step re-reads under a distinct id because activation consumes the version Id specifically. Read childRelationships.GenAiPromptTemplateVersions[].fields.Id.value; pick the entry whose fields.Status.value == 'Published' (the pre-active version).
|
|
237
|
+
|
|
238
|
+
**Call:** `GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}`
|
|
239
|
+
|
|
240
|
+
**Inputs:**
|
|
241
|
+
|
|
242
|
+
- `promptTemplateDevName` *(`String`)* — Fixed 'Pre_Work_Brief' for this workflow.
|
|
243
|
+
|
|
244
|
+
**Depends on:** `verify-workorder-scheduled`, `point-existing-workorder`
|
|
245
|
+
|
|
246
|
+
**Output:** childRelationships.GenAiPromptTemplateVersions[].fields.Id.value — the 3vN-prefix version Id activate-prompt-template consumes. The GET works even while the template is inactive/absent from the runtime catalog.
|
|
247
|
+
|
|
248
|
+
**Notes:** branch_join: Join point for both test-data branches. verify-workorder-scheduled is the fresh-branch tail; point-existing-workorder is the existing-branch tail. The two are mutex, so exactly one predecessor runs — activation fires in either mode. Treat depends_on here as an OR-join, not a barrier.
|
|
249
|
+
|
|
250
|
+
### Write operations
|
|
251
|
+
|
|
252
|
+
#### `assign-psl-admin`
|
|
253
|
+
|
|
254
|
+
Grant the Einstein-for-Field-Service PSL to the admin user via PermissionSetLicenseAssign create. Idempotent: swallow DUPLICATE_VALUE (STATUSCODE) as already-assigned success.
|
|
255
|
+
|
|
256
|
+
**Call:** `POST /services/data/v67.0/sobjects/PermissionSetLicenseAssign`
|
|
257
|
+
|
|
258
|
+
**Inputs:**
|
|
259
|
+
|
|
260
|
+
- `AssigneeId` *(`String`)* — 18-char User Id (005-prefixed).
|
|
261
|
+
- `PermissionSetLicenseId` *(`String`)* — 0PL-prefixed PSL Id from verify-provisioning.
|
|
262
|
+
- **Source:** output of `verify-provisioning`
|
|
263
|
+
|
|
264
|
+
**Depends on:** `verify-provisioning`
|
|
265
|
+
|
|
266
|
+
**Rollback:** DELETE /sobjects/PermissionSetLicenseAssign/{id}
|
|
267
|
+
|
|
268
|
+
**Notes:** idempotency: DUPLICATE_VALUE -> success (already assigned)
|
|
269
|
+
|
|
270
|
+
#### `assign-perms-admin`
|
|
271
|
+
|
|
272
|
+
Grant EinsteinGPTPromptTemplateManager to the admin — this provides Prompt Studio authoring access. NOTE (corrected 2026-08-25): this permset does NOT make the Pre-Work Brief template TYPE visible; the type is gated by UserPermission ShowPreWorkBriefGA (see assign-fs-einstein-user-admin). On a full FS eval org ShowPreWorkBriefGA is ambient so this permset alone appeared sufficient, but on a fresh org it is not. Idempotent: swallow DUPLICATE_VALUE as already-assigned.
|
|
273
|
+
|
|
274
|
+
**Call:** `POST /services/data/v67.0/sobjects/PermissionSetAssignment`
|
|
275
|
+
|
|
276
|
+
**Inputs:**
|
|
277
|
+
|
|
278
|
+
- `AssigneeId` *(`String`)*
|
|
279
|
+
- `PermissionSetId` *(`String`)* — 0PS-prefixed PermissionSet Id. Resolve via SELECT Id FROM PermissionSet WHERE Name='EinsteinGPTPromptTemplateManager'.
|
|
280
|
+
|
|
281
|
+
**Depends on:** `assign-psl-admin`
|
|
282
|
+
|
|
283
|
+
**Rollback:** DELETE /sobjects/PermissionSetAssignment/{id}
|
|
284
|
+
|
|
285
|
+
**Notes:** idempotency: DUPLICATE_VALUE -> success; skill_gotcha: Skipping this before deploy-prompt-template-header produces silent failure (missing dropdown option, no error).
|
|
286
|
+
|
|
287
|
+
#### `deploy-prompt-template-header`
|
|
288
|
+
|
|
289
|
+
Create the Pre_Work_Brief GenAiPromptTemplate (type einstein_gpt__fieldServicePreWorkBrief) in ONE insertPromptTemplate call that carries the version + WorkOrder input + Flow DataProvider inline via childRelationships. insertPromptTemplate rejects a bare header ("Prompt Template[null] has no versions"), and createPromptTemplateVersion only adds versions to an already-existing template, so header + version + input + provider are created together in a single transaction. Skipped when detect-existing-template returned 200. Adjusted-from the skill's MDAPI-deploy assumption: /headless/metadata is not routed on this dispatcher; einstein-prompt-studio is the canonical replacement.
|
|
290
|
+
|
|
291
|
+
**Call:** `PATCH /headless/invoke/platform/einstein-prompt-studio/insert-prompt-template`
|
|
292
|
+
|
|
293
|
+
**Inputs:**
|
|
294
|
+
|
|
295
|
+
- `promptTemplate` *(`object`)* — Complete GenAiPromptTemplate as a single-call insert, sent as a JSON object (NOT a
|
|
296
|
+
serialized string). Exact nested shape (each node uses the wrapper form
|
|
297
|
+
{apiName, id:null, isStandard:false, isOverridable:false, additionalFields:{}, fields:{...}, childRelationships:{...}}).
|
|
298
|
+
apiName MUST be the node's ENTITY TYPE NAME (NOT null): 'GenAiPromptTemplate' for the top
|
|
299
|
+
node, then 'GenAiPromptTemplateVersion', 'GenAiPromptTemplateInput',
|
|
300
|
+
'GenAiPromptTemplateDataProvider', 'GenAiPromptTemplateDataProviderParam' on the nested
|
|
301
|
+
nodes. A null apiName throws CONTROLLER_ERROR ("Cannot invoke String.equals ...
|
|
302
|
+
getApiName() is null"). The Flow reference (DataProvider Definition/ReferenceName and the
|
|
303
|
+
version Content merge field) MUST use the fully-qualified namespaced flow name
|
|
304
|
+
sfdc_fieldservice__ModifyPWB — the bare FlowDefinitionView.ApiName (ModifyPWB)
|
|
305
|
+
fails flow-accessibility ("ModifyPWB is not accessible"):
|
|
306
|
+
|
|
307
|
+
promptTemplate.fields:
|
|
308
|
+
DeveloperName='Pre_Work_Brief', MasterLabel='Pre-Work Brief',
|
|
309
|
+
Type='einstein_gpt__fieldServicePreWorkBrief', Visibility='Global'
|
|
310
|
+
|
|
311
|
+
promptTemplate.childRelationships.GenAiPromptTemplateVersions[0]:
|
|
312
|
+
.fields: Content='{!$Flow:sfdc_fieldservice__ModifyPWB.Prompt}',
|
|
313
|
+
PrimaryModel='sfdc_ai__DefaultOpenAIGPT4OmniMini'
|
|
314
|
+
.childRelationships.GenAiPromptTemplateInputs[0].fields:
|
|
315
|
+
ApiName='WorkOrder' (MUST equal the template type's schema input name),
|
|
316
|
+
ReferenceName='Input:WorkOrder', MasterLabel='Work Order',
|
|
317
|
+
Definition='SOBJECT://WorkOrder', IsRequired=true
|
|
318
|
+
.childRelationships.GenAiPromptTemplateDataProviders[0]:
|
|
319
|
+
.fields: Definition='flow://sfdc_fieldservice__ModifyPWB',
|
|
320
|
+
ReferenceName='Flow:sfdc_fieldservice__ModifyPWB'
|
|
321
|
+
.childRelationships.GenAiPromptTemplateDataProviderParams[0].fields:
|
|
322
|
+
Definition='SOBJECT://WorkOrder', ParameterName='WorkOrder',
|
|
323
|
+
IsRequired=true, ValueExpression='{!$Input:WorkOrder}'
|
|
324
|
+
|
|
325
|
+
The Flow DataProvider MUST be supplied explicitly: when the configured-action gate is
|
|
326
|
+
enabled only DataGraph providers auto-derive; Flow providers are client-managed. Prereq:
|
|
327
|
+
the target org must have the sfdc_fieldservice__ModifyPWB flow (ProcessType=PromptFlow,
|
|
328
|
+
active) with a WorkOrder input variable, else MissingTemplateInputs / provider validation
|
|
329
|
+
recurs.
|
|
330
|
+
|
|
331
|
+
**Depends on:** `detect-existing-template`
|
|
332
|
+
|
|
333
|
+
**Output:** Created template record with 0hf-prefixed Id, DeveloperName, MasterLabel, IsActive=false, plus the inline version (LastCreatedVersionId 3vN-prefixed, LastUsedVersionNumber=1).
|
|
334
|
+
|
|
335
|
+
#### `deploy-lds-setting`
|
|
336
|
+
|
|
337
|
+
Enable Lightning Data Service for Field Service Mobile via saveFieldServiceSettingsConfig. REQUEST SHAPE (load-bearing): the PATCH body MUST wrap the deltas under a top-level "userSettings" key — {"userSettings": {"lsdkForFieldServiceMobilePref": true, "isChangedLsdkForFieldServiceMobilePref": true}}. A flat body (fields at the top level) throws 500 CONTROLLER_ERROR NullPointerException ("userSettings is null"). Inside userSettings the controller uses isChanged<Field> partial-patch semantics: pass lsdkForFieldServiceMobilePref=true AND isChangedLsdkForFieldServiceMobilePref=true together — omitting the isChanged flag returns 200 with body:true but silently persists NOTHING. Send only the deltas plus their paired isChanged flags inside userSettings, NOT the whole read-back map. A 200 with body:true does NOT by itself prove persistence — always verify via read-back on getFieldServiceSettingsConfig.
|
|
338
|
+
|
|
339
|
+
**Call:** `PATCH /headless/invoke/platform/document-builder-rlm/save-field-service-settings-config`
|
|
340
|
+
|
|
341
|
+
**Inputs:**
|
|
342
|
+
|
|
343
|
+
- `lsdkForFieldServiceMobilePref` *(`boolean`)* — Target value for the Lightning-SDK-for-Field-Service-Mobile org preference (true to enable). Backed by ORG_PREFERENCE_LSDK_FOR_FIELD_SERVICE_MOBILE.
|
|
344
|
+
- `isChangedLsdkForFieldServiceMobilePref` *(`boolean`)* — MUST be true for lsdkForFieldServiceMobilePref to be persisted. The controller's per-field isChanged<Field> gate silently skips any field whose paired flag is absent or false — a 200 response body of {body:true} does NOT confirm the value landed. Always verify via read-back on getFieldServiceSettingsConfig.
|
|
345
|
+
|
|
346
|
+
**Depends on:** `read-fieldservice-settings`
|
|
347
|
+
|
|
348
|
+
**Rollback:** Re-PATCH with lsdkForFieldServiceMobilePref=<pre-write snapshot value> AND isChangedLsdkForFieldServiceMobilePref=true.
|
|
349
|
+
|
|
350
|
+
**Notes:** partial_patch_semantics: Per-field isChanged<Field> gate. 200 with body:true does not confirm the write; always read-back.
|
|
351
|
+
|
|
352
|
+
#### `deploy-field-access-permset`
|
|
353
|
+
|
|
354
|
+
Create PermissionSet 'PreWorkBrief_Field_Access' + FieldPermissions row for WorkOrder.PreWorkBriefPromptTemplate (grant Read). Native CRUD replaces the skill's assumed MDAPI-deploy path. Idempotent: DUPLICATE_DEVELOPER_NAME on the PermissionSet insert is swallowed and existing permset is reused.
|
|
355
|
+
|
|
356
|
+
**Call:** `POST /services/data/v67.0/sobjects/PermissionSet`
|
|
357
|
+
|
|
358
|
+
**Inputs:**
|
|
359
|
+
|
|
360
|
+
- `Name` *(`String`)* — 'PreWorkBrief_Field_Access'
|
|
361
|
+
- `Label` *(`String`)* — 'Pre-Work Brief Field Access'
|
|
362
|
+
|
|
363
|
+
**Depends on:** `verify-lds-enabled`
|
|
364
|
+
|
|
365
|
+
**Output:** Created PermissionSet Id (0PS-prefixed); use as ParentId for the follow-up POST /sobjects/FieldPermissions with SobjectType='WorkOrder', Field='WorkOrder.PreWorkBriefPromptTemplate', PermissionsRead=true.
|
|
366
|
+
|
|
367
|
+
**Rollback:** DELETE /sobjects/PermissionSet/{id}
|
|
368
|
+
|
|
369
|
+
**Notes:** composite: Follow-up: POST /sobjects/FieldPermissions with ParentId=<permset>, SobjectType='WorkOrder', Field='WorkOrder.PreWorkBriefPromptTemplate', PermissionsRead=true.
|
|
370
|
+
|
|
371
|
+
#### `assign-perms-technician`
|
|
372
|
+
|
|
373
|
+
Grant PSL + FieldServiceMobileStandardPermSet + PreWorkBrief_Field_Access to the pilot technician. Three writes (PermissionSetLicenseAssign + two PermissionSetAssignment). Idempotent: DUPLICATE_VALUE swallowed per row.
|
|
374
|
+
|
|
375
|
+
**Call:** `POST /services/data/v67.0/sobjects/PermissionSetAssignment`
|
|
376
|
+
|
|
377
|
+
**Inputs:**
|
|
378
|
+
|
|
379
|
+
- `AssigneeId` *(`String`)* — Pilot technician User Id.
|
|
380
|
+
- `PermissionSetId` *(`String`)* — Repeat call once per permset. PSL is granted via POST /sobjects/PermissionSetLicenseAssign with PermissionSetLicenseId.
|
|
381
|
+
|
|
382
|
+
**Depends on:** `deploy-field-access-permset`
|
|
383
|
+
|
|
384
|
+
**Rollback:** DELETE /sobjects/PermissionSetAssignment/{id} for each row (and DELETE /sobjects/PermissionSetLicenseAssign/{id} for the PSL).
|
|
385
|
+
|
|
386
|
+
**Notes:** idempotency: DUPLICATE_VALUE -> success per row
|
|
387
|
+
|
|
388
|
+
#### `create-test-workorder`
|
|
389
|
+
|
|
390
|
+
Create a test WorkOrder pointed at Pre_Work_Brief via PreWorkBriefPromptTemplate. Skipped in test-data-mode=existing (point-existing-workorder branch takes over). Idempotency tag Subject with 'B4Expertise_<run_id>_create-test-workorder' for post-run cleanup.
|
|
391
|
+
|
|
392
|
+
**Call:** `POST /services/data/v67.0/sobjects/WorkOrder`
|
|
393
|
+
|
|
394
|
+
**Inputs:**
|
|
395
|
+
|
|
396
|
+
- `Subject` *(`String`)* — Tag with 'B4Expertise_<run_id>_create-test-workorder' for post-run cleanup.
|
|
397
|
+
- `Status` *(`String`)* — e.g. 'New'
|
|
398
|
+
- `PreWorkBriefPromptTemplate` *(`String`)* — WorkOrder.PreWorkBriefPromptTemplate is a lookup to GenAiPromptTemplate — pass the 0hf-prefix template Id, NOT the DeveloperName. Resolve the Id from the verify-template-deployed response body (GET /einstein/prompt-templates/Pre_Work_Brief): read the top-level "id", or the "Id" value under the "fields" object. Passing DeveloperName 'Pre_Work_Brief' returns 400 INVALID_INPUT "Enter a valid Pre-Work Brief prompt template ID".
|
|
399
|
+
|
|
400
|
+
**Depends on:** `verify-field-on-layout`
|
|
401
|
+
|
|
402
|
+
**Rollback:** DELETE /sobjects/WorkOrder/{id}
|
|
403
|
+
|
|
404
|
+
#### `create-service-appointment`
|
|
405
|
+
|
|
406
|
+
Create the ServiceAppointment for the test WorkOrder with SchedStartTime/SchedEndTime inside today's window (so the technician can pull it up on device today).
|
|
407
|
+
|
|
408
|
+
**Call:** `POST /services/data/v67.0/sobjects/ServiceAppointment`
|
|
409
|
+
|
|
410
|
+
**Inputs:**
|
|
411
|
+
|
|
412
|
+
- `ParentRecordId` *(`String`)* — WorkOrder Id from create-test-workorder.
|
|
413
|
+
- **Source:** output of `create-test-workorder`
|
|
414
|
+
- `SchedStartTime` *(`String`)* — ISO datetime inside today's window.
|
|
415
|
+
- `SchedEndTime` *(`String`)*
|
|
416
|
+
|
|
417
|
+
**Depends on:** `create-test-workorder`
|
|
418
|
+
|
|
419
|
+
**Rollback:** DELETE /sobjects/ServiceAppointment/{id}
|
|
420
|
+
|
|
421
|
+
#### `assign-resource`
|
|
422
|
+
|
|
423
|
+
Create AssignedResource linking the pilot technician's ServiceResource to the test ServiceAppointment. Resolve ServiceResource via SELECT Id FROM ServiceResource WHERE RelatedRecordId='<pilot-user-id>' AND IsActive=true.
|
|
424
|
+
|
|
425
|
+
**Call:** `POST /services/data/v67.0/sobjects/AssignedResource`
|
|
426
|
+
|
|
427
|
+
**Inputs:**
|
|
428
|
+
|
|
429
|
+
- `ServiceAppointmentId` *(`String`)*
|
|
430
|
+
- `ServiceResourceId` *(`String`)*
|
|
431
|
+
|
|
432
|
+
**Depends on:** `create-service-appointment`
|
|
433
|
+
|
|
434
|
+
**Rollback:** DELETE /sobjects/AssignedResource/{id}
|
|
435
|
+
|
|
436
|
+
#### `point-existing-workorder`
|
|
437
|
+
|
|
438
|
+
Existing-test-data branch: PATCH an EXISTING real WorkOrder's PreWorkBriefPromptTemplate to the Pre_Work_Brief template Id AND PATCH its ServiceAppointment's SchedStartTime/SchedEndTime into today's window. Replaces create-test-workorder -> create-service-appointment -> assign-resource when test-data-mode=existing.
|
|
439
|
+
|
|
440
|
+
**Call:** `PATCH /services/data/v67.0/sobjects/WorkOrder/{Id}`
|
|
441
|
+
|
|
442
|
+
**Inputs:**
|
|
443
|
+
|
|
444
|
+
- `Id` *(`String`)* — Path — WorkOrder Id supplied by coordinating skill.
|
|
445
|
+
- `PreWorkBriefPromptTemplate` *(`String`)* — 0hf-prefix GenAiPromptTemplate Id (NOT DeveloperName). Resolve via verify-template-deployed's response body. DeveloperName 'Pre_Work_Brief' returns 400 INVALID_INPUT on PATCH.
|
|
446
|
+
|
|
447
|
+
**Depends on:** `verify-field-on-layout`
|
|
448
|
+
|
|
449
|
+
**Rollback:** Snapshot prior PreWorkBriefPromptTemplate + SA SchedStart/End before PATCH; PATCH back on rollback.
|
|
450
|
+
|
|
451
|
+
**Notes:** composite: Follow-up: PATCH /sobjects/ServiceAppointment/{SA-Id} with SchedStartTime + SchedEndTime inside today's window.; branch: Executes only when test-data-mode=='existing'. Mutex with create-test-workorder / create-service-appointment / assign-resource.
|
|
452
|
+
|
|
453
|
+
#### `activate-prompt-template`
|
|
454
|
+
|
|
455
|
+
Flip Pre_Work_Brief from Published to Active via the einstein-gpt-connect-api version-status endpoint. Empty request body. On success the response is isSuccessful:true, statusCode:"200", additionalData.wrappedMap.summary.overallSeverity:"SAFE"; template-level IsActive flips to true and ActiveVersionId is populated (the version's own Status stays Published — "Published" at the version level *is* "Active" at the template level). Idempotent: re-activating an already-Active version returns 200 SAFE. Endpoint is @ConnectHidden(from=Apex) — call via dispatch / native REST, not ConnectApi.
|
|
456
|
+
|
|
457
|
+
**Call:** `PUT /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}/status?action=activate&ignoreWarnings=false`
|
|
458
|
+
|
|
459
|
+
**Inputs:**
|
|
460
|
+
|
|
461
|
+
- `promptTemplateDevName` *(`String`)* — Path parameter. Fixed 'Pre_Work_Brief' for this workflow.
|
|
462
|
+
- `versionId` *(`String`)* — Path parameter. 3vN-prefix version Id from resolve-template-version.
|
|
463
|
+
- **Source:** output of `resolve-template-version`
|
|
464
|
+
- `action` *(`String`)* — Query parameter. 'activate' (this step) or 'deactivate' (rollback). No default.
|
|
465
|
+
- `ignoreWarnings` *(`boolean`)* — Query parameter. Default false. Set true to accept a WARNING-severity safe-change evaluation and force activation anyway; leave false when you want the platform's safe-change rules to block risky activations.
|
|
466
|
+
|
|
467
|
+
**Depends on:** `resolve-template-version`
|
|
468
|
+
|
|
469
|
+
**Output:** isSuccessful:true, statusCode:"200", errorMessages:[], hasWarning:false, warningMessages:[], templateId echoed, templateType:"einstein_gpt__fieldServicePreWorkBrief", versionId echoed, additionalData.wrappedMap.summary.overallSeverity:"SAFE" (or "WARNING"/"ERROR"). Post-write side-effects: fields.IsActive flips false→true; fields.ActiveVersionId populated with the passed versionId.
|
|
470
|
+
|
|
471
|
+
**Rollback:** PUT /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}/versions/{versionId}/status?action=deactivate
|
|
472
|
+
|
|
473
|
+
**Notes:** empty_body: The request body is empty ({}). No fields.; apex_hidden: Endpoint is @ConnectHidden(from=Apex) — NOT callable from ConnectApi.EinsteinLLM. Call via dispatch / `sf api request rest --method PUT` / any native REST client.; access_check: x-sfdc.org-access-check: EinsteinGPT.orgHasEinsteinGPTEnabled — Einstein GPT must be enabled on the org.; idempotency: Re-activating an already-Active version returns 200 SAFE without error. Safe to re-run.; api_version: Available since v65.0 (API 258 onward). Earlier versions (v62-v66 partial) or the wrong URL shape (/activate rather than /versions/{id}/status?action=activate) return non-2xx.
|
|
474
|
+
|
|
475
|
+
#### `assign-fs-einstein-psl-admin`
|
|
476
|
+
|
|
477
|
+
Grant the EinsteinFieldServicePsl PSL ("Einstein for Field Service") to the admin. This PSL licenses UserPermission ShowPreWorkBriefGA, the gate for the fieldServicePreWorkBrief template type. Idempotent: swallow DUPLICATE_VALUE as already-assigned success.
|
|
478
|
+
|
|
479
|
+
**Call:** `POST /services/data/v67.0/sobjects/PermissionSetLicenseAssign`
|
|
480
|
+
|
|
481
|
+
**Inputs:**
|
|
482
|
+
|
|
483
|
+
- `AssigneeId` *(`String`)* — 18-char admin User Id (005-prefixed).
|
|
484
|
+
- `PermissionSetLicenseId` *(`String`)* — 0PL-prefixed PSL Id. Resolve via SELECT Id FROM PermissionSetLicense WHERE DeveloperName='EinsteinFieldServicePsl'.
|
|
485
|
+
|
|
486
|
+
**Depends on:** `verify-permset-admin`
|
|
487
|
+
|
|
488
|
+
**Rollback:** DELETE /sobjects/PermissionSetLicenseAssign/{id}
|
|
489
|
+
|
|
490
|
+
**Notes:** idempotency: DUPLICATE_VALUE -> success (already assigned)
|
|
491
|
+
|
|
492
|
+
#### `assign-fs-einstein-user-admin`
|
|
493
|
+
|
|
494
|
+
Grant the EinsteinFieldServiceUser permset (PermissionsShowPreWorkBriefGA=true) to the admin. This grants UserPermission ShowPreWorkBriefGA which makes the fieldServicePreWorkBrief template type valid in getPromptTemplateTypes / insertPromptTemplate. LOAD-BEARING: must land BEFORE deploy-prompt-template-header or the type is "not valid". Idempotent.
|
|
495
|
+
|
|
496
|
+
**Call:** `POST /services/data/v67.0/sobjects/PermissionSetAssignment`
|
|
497
|
+
|
|
498
|
+
**Inputs:**
|
|
499
|
+
|
|
500
|
+
- `AssigneeId` *(`String`)*
|
|
501
|
+
- `PermissionSetId` *(`String`)* — 0PS-prefixed PermissionSet Id. Resolve via SELECT Id FROM PermissionSet WHERE Name='EinsteinFieldServiceUser'.
|
|
502
|
+
|
|
503
|
+
**Depends on:** `assign-fs-einstein-psl-admin`
|
|
504
|
+
|
|
505
|
+
**Rollback:** DELETE /sobjects/PermissionSetAssignment/{id}
|
|
506
|
+
|
|
507
|
+
**Notes:** idempotency: DUPLICATE_VALUE -> success; skill_gotcha: Without this the deploy fails "Prompt Template Type is not valid" (silent on a full FS eval org where the perm is ambient).
|
|
508
|
+
|
|
509
|
+
#### `add-field-to-layout`
|
|
510
|
+
|
|
511
|
+
Add WorkOrder.PreWorkBriefPromptTemplate to the technician's Work Order page layout via a Tooling API Layout.Metadata round-trip (NOT a gap — the earlier "no whole-layout write API" note was wrong for the dispatch surface; /headless/metadata is unrouted but Tooling REST passes through, and this is NOT SOAP MDAPI). Round-trip: (1) resolve the layout Id — GET /tooling/query?q=SELECT Id, Name, TableEnumOrId FROM Layout WHERE TableEnumOrId='WorkOrder' (00h-prefixed Id); (2) read full metadata — GET /tooling/sobjects/Layout/{id}, keep the Metadata object; (3) insert a layoutItem {behavior:'Edit', field:'PreWorkBriefPromptTemplate'} into a layoutSections[].layoutColumns[].layoutItems[] (e.g. the "Information" section); (4) PATCH /tooling/sobjects/Layout/{id} with {"Metadata": <full round-tripped object>} — HTTP 204 = success. A Tooling Metadata write is FULL-REPLACE, so round-trip the ENTIRE Metadata object and change only the added item. TWO write-time footguns (each makes the PATCH 400): (a) feedLayout.rightComponents[].componentType reads back as a string but the writer rejects it ("Cannot deserialize instance of complexvalue from VALUE_STRING") — set feedLayout:null for the write (resets the Chatter feed VIEW layout to default); (b) the ServiceReportRelatedList related list fails write validation ("Mass quick actions don't support ServiceReport") — drop that one relatedLists entry. Both are full-replace side effects (feed view reset; Service Reports related list removed), acceptable for surfacing the field and reversible in the Layout Editor. Field-level security is granted separately by deploy-field-access-permset (FieldPermissions) — this step is layout placement only.
|
|
512
|
+
|
|
513
|
+
**Call:** `PATCH /services/data/v67.0/tooling/sobjects/Layout/{layoutId}`
|
|
514
|
+
|
|
515
|
+
**Inputs:**
|
|
516
|
+
|
|
517
|
+
- `layoutId` *(`String`)* — 00h-prefixed Layout Id. Resolve via GET /tooling/query?q=SELECT Id FROM Layout WHERE TableEnumOrId='WorkOrder'.
|
|
518
|
+
- `Metadata` *(`object`)* — Full Layout Metadata object round-tripped from GET /tooling/sobjects/Layout/{id}, with one added layoutItem {behavior:'Edit', field:'PreWorkBriefPromptTemplate'} in a layoutSections column. Set feedLayout:null and drop the ServiceReportRelatedList relatedLists entry (see description footguns). Full-replace semantics — omitted keys reset to default.
|
|
519
|
+
|
|
520
|
+
**Depends on:** `read-workorder-layout`
|
|
521
|
+
|
|
522
|
+
**Output:** HTTP 204 No Content = layout updated. Confirm via verify-field-on-layout (describe/layouts scan).
|
|
523
|
+
|
|
524
|
+
**Rollback:** Re-PATCH /tooling/sobjects/Layout/{id} with the pre-write Metadata snapshot captured in step (2).
|
|
525
|
+
|
|
526
|
+
**Notes:** transport: Tooling REST via native passthrough on dispatch — NOT Metadata API SOAP. /headless/metadata remains unrouted.; full_replace: A Tooling Metadata write replaces the whole layout; round-trip the entire Metadata object, changing only the added item.; write_footguns: feedLayout must be nulled (writer rejects the round-tripped componentType string); ServiceReportRelatedList must be dropped ("Mass quick actions don't support ServiceReport"). Both are full-replace side effects.
|
|
527
|
+
|
|
528
|
+
### Verify operations
|
|
529
|
+
|
|
530
|
+
#### `verify-provisioning`
|
|
531
|
+
|
|
532
|
+
Read PermissionSetLicense for EinsteinFieldServicePsl. Zero rows means the org is unprovisioned; coordinating skill routes to STOP. Idempotent read.
|
|
533
|
+
|
|
534
|
+
**Call:** `GET /services/data/v67.0/query`
|
|
535
|
+
|
|
536
|
+
**Inputs:**
|
|
537
|
+
|
|
538
|
+
- `q` *(`String`)* — SOQL: SELECT Id, DeveloperName FROM PermissionSetLicense WHERE DeveloperName='EinsteinFieldServicePsl'
|
|
539
|
+
|
|
540
|
+
**Output:** records[0].Id = the 0PL-prefixed PSL Id used by assign-psl-admin / assign-perms-technician.
|
|
541
|
+
|
|
542
|
+
#### `verify-permset-admin`
|
|
543
|
+
|
|
544
|
+
SOQL confirm the admin holds EinsteinGPTPromptTemplateManager before the prompt-template deploy. Guard against the silent-dropdown-missing failure mode.
|
|
545
|
+
|
|
546
|
+
**Call:** `GET /services/data/v67.0/query`
|
|
547
|
+
|
|
548
|
+
**Inputs:**
|
|
549
|
+
|
|
550
|
+
- `q` *(`String`)* — SELECT Id FROM PermissionSetAssignment WHERE AssigneeId='<admin>' AND PermissionSet.Name='EinsteinGPTPromptTemplateManager'
|
|
551
|
+
|
|
552
|
+
**Depends on:** `assign-perms-admin`
|
|
553
|
+
|
|
554
|
+
**Output:** totalSize>=1 -> gate cleared.
|
|
555
|
+
|
|
556
|
+
#### `detect-existing-template`
|
|
557
|
+
|
|
558
|
+
Read Pre_Work_Brief via the runtime catalog. Two roles: (1) idempotency gate — 200 with fields.DeveloperName='Pre_Work_Brief' -> skip deploy-prompt-template-header / -version; 404 -> proceed; (2) pre-activation pre-read — captures fields.IsActive + fields.ActiveVersionId. GenAiPromptTemplate is NOT SOQL/Tooling queryable; this Connect API is the canonical read path.
|
|
559
|
+
|
|
560
|
+
**Call:** `GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}`
|
|
561
|
+
|
|
562
|
+
**Inputs:**
|
|
563
|
+
|
|
564
|
+
- `promptTemplateDevName` *(`String`)* — Fixed 'Pre_Work_Brief' for this workflow.
|
|
565
|
+
|
|
566
|
+
**Depends on:** `verify-showpreworkbrief-perm`
|
|
567
|
+
|
|
568
|
+
**Output:** fields.Id = 0hf-prefixed template Id; fields.IsActive boolean; fields.ActiveVersionId (populated when Active, else null); childRelationships.GenAiPromptTemplateVersions[].fields.Id.value = 3vN-prefix version Ids (Published even when template Inactive).
|
|
569
|
+
|
|
570
|
+
**Notes:** skill_gotcha: SOQL/Tooling on GenAiPromptTemplate returns INVALID_TYPE 400. This Connect API is the ONLY read path.
|
|
571
|
+
|
|
572
|
+
#### `verify-template-deployed`
|
|
573
|
+
|
|
574
|
+
Post-deploy read-back on Pre_Work_Brief. Confirm fields.Id populated and childRelationships.GenAiPromptTemplateVersions carries the deployed version with Status='Published'. Same endpoint as detect-existing-template — the pre/post-deploy contract. Emits the 0hf-prefix template Id downstream steps need (create-test-workorder / point-existing-workorder read fields.Id from this response).
|
|
575
|
+
|
|
576
|
+
**Call:** `GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}`
|
|
577
|
+
|
|
578
|
+
**Inputs:**
|
|
579
|
+
|
|
580
|
+
- `promptTemplateDevName` *(`String`)*
|
|
581
|
+
|
|
582
|
+
**Depends on:** `deploy-prompt-template-header`
|
|
583
|
+
|
|
584
|
+
**Output:** fields.Id present (0hf-prefix — downstream WorkOrder.PreWorkBriefPromptTemplate lookup consumes this); childRelationships.GenAiPromptTemplateVersions[].fields.Status == 'Published'; fields.IsActive == false pre-activation (flip happens in activate-prompt-template).
|
|
585
|
+
|
|
586
|
+
#### `verify-lds-enabled`
|
|
587
|
+
|
|
588
|
+
Read-back on Field Service settings; confirm body.body.lsdkForFieldServiceMobilePref==true after the write. Same endpoint as read-fieldservice-settings — the pre/post-write contract. Required because deploy-lds-setting returns 200 whether or not its paired isChanged flag was set.
|
|
589
|
+
|
|
590
|
+
**Call:** `GET /headless/invoke/platform/document-builder`
|
|
591
|
+
|
|
592
|
+
**Depends on:** `deploy-lds-setting`
|
|
593
|
+
|
|
594
|
+
**Output:** body.body.lsdkForFieldServiceMobilePref == true after the write. Drift here proves deploy-lds-setting was missing the paired isChangedLsdkForFieldServiceMobilePref flag.
|
|
595
|
+
|
|
596
|
+
#### `verify-field-on-layout`
|
|
597
|
+
|
|
598
|
+
Scan WorkOrder layouts describe (GET /sobjects/WorkOrder/describe/layouts) for a layoutComponent with value='PreWorkBriefPromptTemplate' in the technician's layout sections. Present -> add-field-to-layout landed; absent -> the Tooling Metadata PATCH did not take (re-check the round-trip and the two write footguns).
|
|
599
|
+
|
|
600
|
+
**Call:** `GET /services/data/v67.0/sobjects/WorkOrder/describe/layouts`
|
|
601
|
+
|
|
602
|
+
**Depends on:** `add-field-to-layout`
|
|
603
|
+
|
|
604
|
+
**Output:** Boolean: is PreWorkBriefPromptTemplate present on the technician's layout? If false and add-field-to-layout is unresolved, surface the layout-editor deep-link to the human instead of hard-failing.
|
|
605
|
+
|
|
606
|
+
#### `verify-workorder-scheduled`
|
|
607
|
+
|
|
608
|
+
SOQL smoke: SELECT Id, SchedStartTime FROM ServiceAppointment WHERE WorkOrderId='<test-wo>' AND SchedStartTime = TODAY. Idempotency + landed-in-today's-window contract.
|
|
609
|
+
|
|
610
|
+
**Call:** `GET /services/data/v67.0/query`
|
|
611
|
+
|
|
612
|
+
**Inputs:**
|
|
613
|
+
|
|
614
|
+
- `q` *(`String`)*
|
|
615
|
+
|
|
616
|
+
**Depends on:** `assign-resource`
|
|
617
|
+
|
|
618
|
+
**Output:** totalSize==1 -> chain landed today. Zero -> SA outside today's window or missing.
|
|
619
|
+
|
|
620
|
+
#### `verify-activation`
|
|
621
|
+
|
|
622
|
+
Read the runtime prompt-template catalog to confirm activation landed. Two equivalent reads — pick either. (a) Detail read GET /einstein/prompt-templates/{devName}, confirm fields.IsActive.value==true AND fields.ActiveVersionId.value is populated. (b) Catalog list GET /einstein/prompt-templates?pageSize=200, confirm promptRecords[] contains an entry with fields.DeveloperName.value=='Pre_Work_Brief' AND fields.IsActive.value==true. The catalog-list variant proves the template appears in the runtime catalog (agents / mobile clients can now see it).
|
|
623
|
+
|
|
624
|
+
**Call:** `GET /services/data/v67.0/einstein/prompt-templates/{promptTemplateDevName}`
|
|
625
|
+
|
|
626
|
+
**Inputs:**
|
|
627
|
+
|
|
628
|
+
- `promptTemplateDevName` *(`String`)*
|
|
629
|
+
|
|
630
|
+
**Depends on:** `activate-prompt-template`
|
|
631
|
+
|
|
632
|
+
**Output:** fields.IsActive.value==true AND fields.ActiveVersionId.value populated -> activation landed. Optional catalog-list fallback GET /einstein/prompt-templates?pageSize=200 -> promptRecords[?fields.DeveloperName.value=='Pre_Work_Brief'].fields.IsActive.value==true confirms runtime-catalog visibility.
|
|
633
|
+
|
|
634
|
+
#### `verify-showpreworkbrief-perm`
|
|
635
|
+
|
|
636
|
+
Confirm the admin effectively holds UserPermission ShowPreWorkBriefGA before the prompt-template deploy — the true gate for the fieldServicePreWorkBrief type. Guards against the "Prompt Template Type is not valid" failure.
|
|
637
|
+
|
|
638
|
+
**Call:** `GET /services/data/v67.0/query`
|
|
639
|
+
|
|
640
|
+
**Inputs:**
|
|
641
|
+
|
|
642
|
+
- `q` *(`String`)* — SELECT Id FROM PermissionSetAssignment WHERE AssigneeId='<admin>' AND PermissionSet.Name='EinsteinFieldServiceUser'
|
|
643
|
+
|
|
644
|
+
**Depends on:** `assign-fs-einstein-user-admin`
|
|
645
|
+
|
|
646
|
+
**Output:** totalSize>=1 -> gate cleared (ShowPreWorkBriefGA granted).
|