@salesforce/afv-skills 1.45.0 → 1.47.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/agentforce-observe/SKILL.md +32 -4
- package/skills/agentforce-observe/references/ahm-alerts.md +719 -0
- package/skills/automation-flow-generate/SKILL.md +11 -5
- package/skills/consumer-goods-promotion-bo-api-deploy/SKILL.md +275 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/README.md +32 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/SetCommentValue.cls +75 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/SetCommentValue.cls-meta.xml +5 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/interview-answers.json +13 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/payloads/copy.json +10 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/payloads/create.json +20 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/payloads/update.json +16 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/references/conventions-and-payload-rules.md +273 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/references/generate-and-wire.md +236 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/references/reference-example-set-comment-value.md +132 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/references/smoke-and-verify.md +211 -0
- package/skills/dx-code-analyzer-configure/scripts/validate-config.sh +14 -10
- package/skills/dx-code-analyzer-run/scripts/apply-fixes.js +45 -4
- package/skills/dx-code-analyzer-run/scripts/describe-rule.js +52 -32
- package/skills/dx-devops-project-manage/SKILL.md +197 -0
- package/skills/dx-devops-project-manage/examples/common-workflows.md +197 -0
- package/skills/dx-devops-project-manage/references/cli-commands.md +295 -0
- package/skills/dx-devops-project-manage/scripts/create-project.sh +48 -0
- package/skills/dx-devops-project-manage/scripts/list-projects.sh +51 -0
- package/skills/dx-devops-project-manage/scripts/update-project.sh +96 -0
- package/skills/education-cloud-academic-calendar-generate/SKILL.md +225 -0
- package/skills/education-cloud-academic-calendar-generate/examples/quarter-calendar.json +47 -0
- package/skills/education-cloud-academic-calendar-generate/examples/sample-output.md +57 -0
- package/skills/education-cloud-academic-calendar-generate/examples/semester-calendar.json +54 -0
- package/skills/education-cloud-academic-calendar-generate/references/calendar-systems.md +127 -0
- package/skills/education-cloud-academic-calendar-generate/references/date-validation.md +222 -0
- package/skills/education-cloud-academic-calendar-generate/references/foundation_prerequisites.md +40 -0
- package/skills/education-cloud-academic-calendar-generate/scripts/validate_calendar_dates.py +143 -0
- package/skills/education-cloud-course-catalog-migrate/SKILL.md +321 -0
- package/skills/education-cloud-course-catalog-migrate/references/gotchas-detail.md +16 -0
- package/skills/education-cloud-course-catalog-migrate/references/gotchas.md +16 -0
- package/skills/education-cloud-course-catalog-migrate/references/large-catalog-handling.md +42 -0
- package/skills/education-cloud-course-catalog-migrate/scripts/batch_courses.py +36 -0
- package/skills/education-cloud-course-catalog-migrate/scripts/detect_linked_courses.py +51 -0
- package/skills/education-cloud-course-catalog-migrate/scripts/detect_modality_variants.py +48 -0
- package/skills/education-cloud-course-catalog-migrate/scripts/resolve_api_version.py +43 -0
- package/skills/education-cloud-course-catalog-migrate/scripts/split_course_code.py +39 -0
- package/skills/education-cloud-course-catalog-migrate/scripts/validate_completeness.py +54 -0
- package/skills/education-cloud-multi-campus-configure/references/foundation_prerequisites.md +3 -5
- package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +177 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/agent-and-subagents.md +151 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/customer-narration.md +34 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/execution-model.md +54 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/flows.md +82 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/grounding.md +199 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/permissions.md +183 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/platform-enablement.md +82 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/prerequisites.md +158 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/routing.md +141 -0
- package/skills/experience-cms-brand-apply/SKILL.md +5 -5
- package/skills/experience-cms-brand-create/SKILL.md +2 -2
- package/skills/experience-cms-content-generate/SKILL.md +1 -0
- package/skills/experience-cms-content-render/SKILL.md +173 -0
- package/skills/experience-cms-content-render/assets/angular/DetailPage.component.ts +25 -0
- package/skills/experience-cms-content-render/assets/angular/MediaRenderer.component.ts +133 -0
- package/skills/experience-cms-content-render/assets/angular/TypeList.component.ts +38 -0
- package/skills/experience-cms-content-render/assets/angular/TypeRenderer.component.ts +90 -0
- package/skills/experience-cms-content-render/assets/angular/cms-content.component.ts +248 -0
- package/skills/experience-cms-content-render/assets/angular/cms-item.service.ts +100 -0
- package/skills/experience-cms-content-render/assets/react/DetailPage.tsx +20 -0
- package/skills/experience-cms-content-render/assets/react/MediaRenderer.tsx +129 -0
- package/skills/experience-cms-content-render/assets/react/TypeList.tsx +40 -0
- package/skills/experience-cms-content-render/assets/react/TypeRenderer.tsx +64 -0
- package/skills/experience-cms-content-render/assets/react/heuristicRenderer.tsx +310 -0
- package/skills/experience-cms-content-render/assets/react/useCmsItem.ts +129 -0
- package/skills/experience-cms-content-render/assets/shared/cmsContentType.ts +49 -0
- package/skills/experience-cms-content-render/assets/shared/cmsCore.types.ts +96 -0
- package/skills/experience-cms-content-render/assets/shared/externalRefs.ts +55 -0
- package/skills/experience-cms-content-render/references/bulk-loading.md +60 -0
- package/skills/experience-cms-content-render/references/codegen-guardrails.md +111 -0
- package/skills/experience-cms-content-render/references/detail-pages.md +87 -0
- package/skills/experience-cms-content-render/references/embed-recipes.md +127 -0
- package/skills/experience-cms-content-render/references/failure-modes.md +96 -0
- package/skills/experience-cms-content-render/references/heuristic-render-rules.md +131 -0
- package/skills/experience-cms-content-render/references/init-scaffold.md +122 -0
- package/skills/experience-cms-content-render/references/interaction-model.md +173 -0
- package/skills/experience-cms-content-render/references/package-api.md +106 -0
- package/skills/experience-cms-content-render/references/schema-sync.md +114 -0
- package/skills/experience-cms-content-render/references/styling-scopes.md +65 -0
- package/skills/experience-cms-content-render/references/verify.md +49 -0
- package/skills/experience-cms-content-type-generate/SKILL.md +2 -2
- package/skills/experience-content-media-stock-image-search/SKILL.md +5 -4
- package/skills/experience-search-coordinate/SKILL.md +198 -0
- package/skills/experience-search-coordinate/assets/search-payload-template.json +25 -0
- package/skills/experience-search-coordinate/references/content-route.md +313 -0
- package/skills/experience-search-coordinate/references/content-type-discovery.md +57 -0
- package/skills/experience-search-coordinate/references/media-route.md +172 -0
- package/skills/experience-search-coordinate/references/scope-resolution.md +14 -0
- package/skills/experience-ui-bundle-localize/SKILL.md +1 -1
- package/skills/experience-ui-bundle-localize/references/i18n-setup.md +5 -3
- package/skills/experience-ui-bundle-project-generate/SKILL.md +18 -14
- package/skills/experience-ui-bundle-project-generate/references/angular-project-generate.md +22 -0
- package/skills/experience-ui-bundle-project-generate/references/react-project-generate.md +20 -0
- package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +58 -54
- package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +6 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/graphiti-cli.md +2 -2
- package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +6 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/rest-and-integration.md +2 -1
- package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +6 -0
- package/skills/experience-ui-bundle-site-generate/SKILL.md +59 -8
- package/skills/experience-ui-bundle-site-generate/references/configure-metadata-digital-experience.md +8 -3
- package/skills/experience-ui-bundle-site-generate/references/configure-metadata-language-settings.md +120 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/SKILL.md +336 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/orchestration-flow.md +143 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-application-flexipage-mapping.md +127 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-deploy-commands.md +116 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-lifesci-metadata-deploy.md +111 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-overview.md +312 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-profile-layout-assignments.md +171 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-state-tracking.md +64 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-trigger-handlers.md +122 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-4-user-provisioning-overview.md +335 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-4-user-provisioning-user-provisioning-details.md +140 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-execution-state-and-recovery.md +196 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-metadata-cache-generation.md +155 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-overview.md +307 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-visit-creation-data.md +211 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/references/state-machine-and-changes.md +108 -0
- package/skills/life-sciences-kam-coordinate/SKILL.md +241 -0
- package/skills/life-sciences-kam-coordinate/references/orchestration-flow.md +152 -0
- package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-application-flexipage-mapping.md +79 -0
- package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-deploy-commands.md +131 -0
- package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-kam-config-records.md +85 -0
- package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-lifesci-metadata-deploy.md +112 -0
- package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-overview.md +202 -0
- package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-profile-layout-assignments.md +67 -0
- package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-state-tracking.md +65 -0
- package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-trigger-handlers.md +123 -0
- package/skills/life-sciences-kam-coordinate/references/stage-4-participant-role-and-sprint.md +89 -0
- package/skills/life-sciences-kam-coordinate/references/stage-5-data-and-plan-templates-overview.md +337 -0
- package/skills/life-sciences-kam-coordinate/references/stage-5-data-creation-data.md +248 -0
- package/skills/life-sciences-kam-coordinate/references/stage-6-ipad-validation-script.md +35 -0
- package/skills/life-sciences-kam-coordinate/references/stage-6-metadata-cache-generation.md +155 -0
- package/skills/life-sciences-kam-coordinate/references/stage-6-user-provisioning-details.md +146 -0
- package/skills/life-sciences-kam-coordinate/references/stage-6-user-provisioning-overview.md +89 -0
- package/skills/life-sciences-kam-coordinate/references/state-machine-and-changes.md +114 -0
- package/skills/life-sciences-prerequisites-validate/SKILL.md +138 -0
- package/skills/life-sciences-prerequisites-validate/references/checks-org-settings.md +190 -0
- package/skills/life-sciences-prerequisites-validate/references/checks-user-and-package.md +211 -0
- package/skills/life-sciences-territory-configure/SKILL.md +217 -0
- package/skills/life-sciences-territory-configure/references/territory-metadata.md +262 -0
- package/skills/platform-apex-logs-debug/SKILL.md +7 -7
- package/skills/platform-custom-application-generate/SKILL.md +4 -4
- package/skills/platform-custom-object-generate/SKILL.md +7 -7
- package/skills/platform-custom-tab-generate/SKILL.md +1 -1
- package/skills/platform-dsar-policy-manage/SKILL.md +272 -0
- package/skills/platform-dsar-policy-manage/references/configure.md +106 -0
- package/skills/platform-dsar-policy-manage/references/export-and-history.md +123 -0
- package/skills/platform-dsar-policy-manage/references/gap-analysis-guide.md +150 -0
- package/skills/platform-dsar-policy-manage/references/gap-scan.md +129 -0
- package/skills/platform-dsar-policy-manage/references/headless-sor.md +59 -0
- package/skills/platform-dsar-policy-manage/references/report-format.md +59 -0
- package/skills/platform-dsar-policy-manage/scripts/tests/__init__.py +0 -0
- package/skills/platform-dsar-policy-manage/scripts/tests/test_validate_policy_tree.py +76 -0
- package/skills/platform-dsar-policy-manage/scripts/validate-policy-tree.py +130 -0
- package/skills/platform-flexipage-generate/SKILL.md +4 -0
- package/skills/platform-list-view-generate/SKILL.md +1 -0
- package/skills/platform-salesforce-connect-adapter-generate/SKILL.md +359 -0
- package/skills/platform-salesforce-connect-adapter-generate/references/official-examples.md +69 -0
- package/skills/platform-salesforce-connect-adapter-generate/references/scenarios.md +187 -0
- package/skills/platform-soql-query/SKILL.md +8 -8
- package/skills/platform-value-set-generate/SKILL.md +2 -2
- package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +20 -27
- package/skills/service-native-voice-recording-transcription-configure/SKILL.md +47 -27
- package/skills/service-native-voice-recording-transcription-configure/references/thunderbird-voice-settings.md +13 -9
- package/skills/service-native-voice-recording-transcription-configure/scripts/enable-recording-transcription.sh +104 -45
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: life-sciences-kam-coordinate
|
|
3
|
+
description: "Use this skill to run the full end-to-end Life Sciences Cloud setup workflow for a key account management (KAM) user in sequence. Trigger when the user says 'set up Life Sciences Cloud end to end for kam user', 'run the full LSC setup for kam user', 'orchestrate Life Sciences Cloud configuration for kam user', 'complete LSC setup for kam user', or 'Life Sciences Cloud full install for kam user'. Executes six stages in order: prerequisites validation, starter config deployment, territory configuration, participant role and sprint creation, KAM data and plan-template (goals, tasks, measures) creation, and KAM user provisioning — gating each stage on the success of the previous one. DO NOT TRIGGER when: the user wants to run only one specific stage individually, or when the request targets a field sales rep rather than a KAM user (use life-sciences-fieldsalesrep-coordinate for that persona)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "65.0"
|
|
7
|
+
domains: ["Life Sciences"]
|
|
8
|
+
relatedSkills:
|
|
9
|
+
- life-sciences-fieldsalesrep-coordinate
|
|
10
|
+
- life-sciences-prerequisites-validate
|
|
11
|
+
- life-sciences-territory-configure
|
|
12
|
+
cliTools:
|
|
13
|
+
- tool: ["git"]
|
|
14
|
+
semver: ">=2.25.0"
|
|
15
|
+
- tool: ["jq"]
|
|
16
|
+
semver: ">=1.6"
|
|
17
|
+
- tool: ["sf"]
|
|
18
|
+
semver: ">=2.0.0"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Life Sciences Cloud KAM End-to-End Orchestrator
|
|
22
|
+
|
|
23
|
+
Runs the complete Life Sciences Cloud setup for a **key account management (KAM)** user as six **stages** in strict sequence, gating each on the previous stage's success. Each stage delegates to a child skill or reference workflow (see Execution Order).
|
|
24
|
+
|
|
25
|
+
## Scope Guard (evaluate FIRST)
|
|
26
|
+
|
|
27
|
+
Serve **only** requests for the full end-to-end LSC setup **for a KAM user**. A single stage/phase/step is **never** invokable here — never silently expand a partial ask into the whole flow. Before any work:
|
|
28
|
+
|
|
29
|
+
- **Field sales rep persona** (not KAM) → redirect to `life-sciences-fieldsalesrep-coordinate`; stop.
|
|
30
|
+
- **Unrelated** to LSC setup (at start or mid-run) → do not attempt it; say you did not understand and show what you can help with (full end-to-end LSC KAM setup, or standalone `life-sciences-prerequisites-validate` / `life-sciences-territory-configure`); stop.
|
|
31
|
+
- **Single stage with its own standalone skill** — prerequisites (1) or territory config (3) → redirect to that skill; stop.
|
|
32
|
+
- **Single stage with no standalone skill** — config deploy (2), participant role/sprint (4), data and plan templates (5), user provisioning (6) → explain these run only inside the full flow; stop. Do **not** launch the full flow unless the user then asks.
|
|
33
|
+
|
|
34
|
+
Continue only for the complete end-to-end KAM setup: the full flow in order with gates, each stage's work delegated to child skills / reference files.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Required Inputs
|
|
39
|
+
|
|
40
|
+
- **Target org**: the org to deploy to — selected by the user from connected orgs or a freshly authenticated org (Phase 0). Never assume a default org silently; the user confirms or selects it before any stage runs.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Execution Order (MANDATORY)
|
|
45
|
+
|
|
46
|
+
> **Terminology:** **Stage** = one of the 6 units of work, each delegated to a child skill/reference; **Phase** = a named group inside a stage; **Step** = an atomic action inside a phase.
|
|
47
|
+
|
|
48
|
+
Run in this order, each gated on the previous (dependency diagram in `references/orchestration-flow.md`):
|
|
49
|
+
|
|
50
|
+
| # | Stage | Runs | Gate (must pass to advance) | Output |
|
|
51
|
+
|---|-------|------|------------------------------|--------|
|
|
52
|
+
| — | **Setup**: download `.lsc-starter-config/LSStarterConfig` | — | Folder present (MANDATORY — hard stop) | Shared source folder in CWD |
|
|
53
|
+
| 1 | Prerequisites Validation | `life-sciences-prerequisites-validate` skill | All prerequisites PASS | Org confirmed ready |
|
|
54
|
+
| 2 | Starter Config Deploy | `references/stage-2-starter-config-overview.md` | 13 deploy steps + KAM config records succeed | LSC Custom Profile + KAM/Sprint settings |
|
|
55
|
+
| 3 | Territory Configuration | `life-sciences-territory-configure` skill | Territory model Active + L3 territory | Level-3 territory ID + name |
|
|
56
|
+
| 4 | Participant Role & Sprint | `references/stage-4-participant-role-and-sprint.md` | Participant role + sprint created | Role + Sprint IDs |
|
|
57
|
+
| 5 | KAM Data & Plan Templates | `references/stage-5-data-and-plan-templates-overview.md` | Account/HCP/product/territory data created + goals, template (Final), items, assignment created + goals/template/PATI shared to the leaf territory | Account + product master data + published ActionPlanTemplate |
|
|
58
|
+
| 6 | KAM User Provisioning | `references/stage-6-user-provisioning-overview.md` | User created, permsets + territory assigned; metadata cache generated | KAM username |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Workflow
|
|
63
|
+
|
|
64
|
+
### Phase 0 — Org Selection (MANDATORY, runs first)
|
|
65
|
+
|
|
66
|
+
Establish which org to use **every time** — never silently reuse the default org.
|
|
67
|
+
|
|
68
|
+
1. **List connected orgs** with `sf org list --json`, then present the authenticated (non-expired) orgs as a numbered list (alias, username, org type, default marker), plus an option **N** to log in to a fresh org.
|
|
69
|
+
2. **Ask the user to choose** a number or **N**.
|
|
70
|
+
3. **Handle the selection**:
|
|
71
|
+
- **Existing org** → capture its username/alias as the target org.
|
|
72
|
+
- **Fresh org (N)** → ask for the login URL (`https://login.salesforce.com`, `https://test.salesforce.com`, or a My Domain URL) and an alias, then **run the login command yourself**: `sf org login web --instance-url <url> --alias <alias> --set-default`. Do not hand the command to the user to run — execute it directly. It opens a browser on the user's machine for them to complete the login interactively; the command then returns. After it finishes, re-run `sf org list --json` to confirm.
|
|
73
|
+
4. **Confirm the target org** back to the user and store it in `OrchestrationState.targetOrg`.
|
|
74
|
+
|
|
75
|
+
> If `sf org list` returns no authenticated orgs, go straight to the fresh-org login (option N).
|
|
76
|
+
|
|
77
|
+
### Phase 1 — Introduction and Confirmation
|
|
78
|
+
|
|
79
|
+
1. **Present the workflow** to the user — a "Life Sciences Cloud — Full KAM Setup Workflow" header, the target org, and the 6 stages in order with a one-line summary each: (1) Validate Prerequisites; (2) Deploy Starter Configuration (objects, profiles, config records incl. KAM & Sprint settings, layouts, flexipages); (3) Configure Territories; (4) Create Participant Role & Sprint; (5) Create KAM Data & Plan Templates (account, provider, product, territory data + goals, tasks, measures, published action plan template); (6) Provision KAM User (profile/permsets/territory + mobile metadata cache).
|
|
80
|
+
|
|
81
|
+
2. **Ask for confirmation**: "Ready to begin the full LSC KAM setup? (yes/no)"
|
|
82
|
+
|
|
83
|
+
3. **Download the shared source folder FRESH (MANDATORY — hard gate, before any stage).** Stages 2 (metadata + config records) and 5 (Data CSVs) read from `.lsc-starter-config/LSStarterConfig/`; those stages do NOT download or delete it — the orchestrator owns one fresh download here and one delete in Phase 9. **Always re-pull — never reuse an existing folder** (a stale copy would skip newly added components). Delete any pre-existing `.lsc-starter-config` first, then sparse-checkout the subtree fresh:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
rm -rf .lsc-starter-config lsstarter-tmp
|
|
87
|
+
git clone --no-checkout --depth 1 --filter=blob:none \
|
|
88
|
+
https://github.com/SalesforceLabs/LSStarterConfig.git lsstarter-tmp
|
|
89
|
+
cd lsstarter-tmp && git sparse-checkout init --cone \
|
|
90
|
+
&& git sparse-checkout set Codey/LSStarterConfig && git checkout && cd ..
|
|
91
|
+
mv lsstarter-tmp/Codey ./.lsc-starter-config && rm -rf lsstarter-tmp
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
> `.lsc-starter-config/LSStarterConfig/` has its own `sfdx-project.json` (pins `sourceApiVersion: 65.0`) — deploy steps must run from inside it.
|
|
95
|
+
|
|
96
|
+
4. **Download gate — verify before proceeding.** Confirm `.lsc-starter-config/LSStarterConfig/sfdx-project.json` and `.lsc-starter-config/LSStarterConfig/Data/` exist (e.g. `ls .lsc-starter-config/LSStarterConfig/sfdx-project.json .lsc-starter-config/LSStarterConfig/Data`).
|
|
97
|
+
- If present → set `sourceFolderDownloaded: true` and proceed to Phase 2.
|
|
98
|
+
- If missing/failed → **STOP. Do NOT proceed to any stage** — every stage depends on this folder. Report the failure (likely: no network / GitHub unreachable, git < 2.25, or disk/permission), leave `sourceFolderDownloaded: false`, and do not advance. Fix the cause and re-run, or download the folder manually into the CWD.
|
|
99
|
+
|
|
100
|
+
### Phase 2 — Execute Stage 1: Prerequisites Validation
|
|
101
|
+
|
|
102
|
+
5. **Run the prerequisites validation** following the `life-sciences-prerequisites-validate` skill workflow exactly.
|
|
103
|
+
|
|
104
|
+
6. **Gate check**: If ALL prerequisites pass → proceed to Stage 2. If ANY fails → **stop**, present the failure table, and ask: "Continue anyway (skip failed prerequisites), or stop and fix them first?" Stop → end the workflow. Continue → proceed with a warning that later stages may fail.
|
|
105
|
+
|
|
106
|
+
### Phase 3 — Execute Stage 2: Starter Config Deploy
|
|
107
|
+
|
|
108
|
+
7. **Run the starter config deployment** following `references/stage-2-starter-config-overview.md` exactly (all 13 deploy steps + the KAM/Sprint config-record edits); read its own reference files as directed. The KAM adaptation deploys only the KAM-relevant layouts (4) and flexipages (6) — all of them, automatically, with no selection prompt — and confirms the StandardValueSet picklist values with the admin (three business-framed groups) BEFORE deploying them, then writes those confirmed values into the `KAMSettings_OrgLevel` and `SprintSettings_OrgLevel` config records.
|
|
109
|
+
|
|
110
|
+
8. **Gate check**: Verify the LSC Custom Profile exists:
|
|
111
|
+
```bash
|
|
112
|
+
sf data query --query "SELECT Id, Name FROM Profile WHERE Name = 'LSC Custom Profile'" --target-org <org> --json
|
|
113
|
+
```
|
|
114
|
+
- If profile exists → proceed to Stage 3. If not found → **stop** and report deployment failure.
|
|
115
|
+
|
|
116
|
+
### Phase 4 — Execute Stage 3: Territory Configuration
|
|
117
|
+
|
|
118
|
+
9. **Run the territory configuration** following the `life-sciences-territory-configure` skill workflow exactly. If an active territory model already exists, use it and show the hierarchy rather than creating a new one.
|
|
119
|
+
|
|
120
|
+
10. **Gate check**: Verify the territory model is Active and a level-3 territory exists:
|
|
121
|
+
```bash
|
|
122
|
+
sf data query --query "SELECT Id, Name, DeveloperName, Territory2Model.State FROM Territory2 WHERE ParentTerritory2.ParentTerritory2Id != null AND Territory2Model.State = 'Active'" --target-org <org> --json
|
|
123
|
+
```
|
|
124
|
+
- If found → **capture the level-3 territory ID + name** (`OrchestrationState.territoryId`) and tell the user this leaf territory is the single territory reused for Stage 5 (ProductTerritoryAvailability) and Stage 6 (UserTerritory2Association for both admin and KAM user). Proceed to Stage 4.
|
|
125
|
+
- If not found → **stop** and report the issue.
|
|
126
|
+
|
|
127
|
+
### Phase 5 — Execute Stage 4: Participant Role & Sprint
|
|
128
|
+
|
|
129
|
+
11. **Create the participant role and sprint** following `references/stage-4-participant-role-and-sprint.md` exactly. Only the `MasterLabel`/`Name` fields are confirmed with the admin; all other fields are auto-derived and shown for confirmation.
|
|
130
|
+
|
|
131
|
+
12. **Gate check**: Verify a `ParticipantRole` (`DeveloperName = 'Rep_Execution_Specialist'`, `IsActive = true`) and a `Sprint` (Status `Not Started`) exist. If either is missing → **stop** and report.
|
|
132
|
+
|
|
133
|
+
### Phase 6 — Execute Stage 5: KAM Data & Plan Templates
|
|
134
|
+
|
|
135
|
+
Both parts run as the admin, in order, from the single reference `references/stage-5-data-and-plan-templates-overview.md` (Part A = data, Part B = plan templates).
|
|
136
|
+
|
|
137
|
+
13. **Create the KAM data (Part A)** following the reference exactly. Pass the Stage-3 level-3 territory. Creates (from the Data CSVs): Account, HealthcareProvider, ObjectTerritory2Association, ProviderAcctTerritoryInfo, Product2, LifeSciMarketableProduct, ContactPointAddress, ProductTerritoryAvailability.
|
|
138
|
+
|
|
139
|
+
14. **Part A gate check**: Verify the Account, `LifeSciMarketableProduct`, and `ProductTerritoryAvailability` (on the Stage-3 territory) exist; capture the `LifeSciMarketableProduct` ID (Part B uses it). If any missing → **stop**.
|
|
140
|
+
|
|
141
|
+
15. **Create the goals, tasks, measures, and action plan template (Part B)** following the same reference exactly (stay on the admin login). Creates 2 `GoalDefinition` records, a `GoalDefinitionProduct`, an `ActionPlanTemplate` (+ auto `ActionPlanTemplateVersion`), 3 `ActionPlanTemplateItem` records, publishes the template (status → Final), creates an `ActionPlanTemplateAssignment`, and shares the 2 `GoalDefinition` records, the `ActionPlanTemplate`, and both `ProviderAcctTerritoryInfo` records to the Stage-3 leaf-territory **Group** (5 manual shares total) so the KAM user reaches them through the territory. Only the record **names** are confirmed with the admin.
|
|
142
|
+
|
|
143
|
+
16. **Part B gate check**: Verify the template is published (a `Final` `ActionPlanTemplateVersion` exists), an `ActionPlanTemplateAssignment` exists, and the leaf-territory shares exist (2 `GoalDefinitionShare` + 1 `ActionPlanTemplateShare` + 2 `ProviderAcctTerritoryInfoShare` whose `UserOrGroupId` is the Stage-3 territory Group). If not → **stop**.
|
|
144
|
+
|
|
145
|
+
### Phase 7 — Execute Stage 6: KAM User Provisioning
|
|
146
|
+
|
|
147
|
+
17. **Provision the KAM user** following `references/stage-6-user-provisioning-overview.md` exactly. Pass the Stage-3 level-3 territory. Creates a user whose username contains `kam`, assigns the permission sets **Health Cloud Starter**, **Life Sciences Key Account Management**, **Life Sciences Field Sales Representative**, and **Life Sciences Core**, assigns **both the admin and the KAM user** to the level-3 territory (confirm with admin — MUST be the same territory used for ProductTerritoryAvailability in Stage 5), and generates the mobile metadata cache via the Connect API.
|
|
148
|
+
|
|
149
|
+
18. **Gate check (STOP-GATE — Stage 6 completeness).** Do NOT accept "user created" as passing. Verify the user is `IsActive=true` on `LSC Custom Profile`, has a `UserTerritory2Association` to the Stage-3 territory, the metadata cache reached `Status='Active'`, and the assigned-permset count is **4** ({HealthCloudStarter, LifeSciencesKeyAccountManager, LifeSciencesFieldSalesRepresentative, LifeSciencesCore}):
|
|
150
|
+
```bash
|
|
151
|
+
sf data query --query "SELECT COUNT(Id) c FROM PermissionSetAssignment WHERE AssigneeId = '<newUserId>' AND PermissionSet.IsOwnedByProfile = false" --target-org <org> --json
|
|
152
|
+
```
|
|
153
|
+
If < 2, or the territory assignment or metadata cache is missing, re-run the missing part before finishing.
|
|
154
|
+
|
|
155
|
+
### Phase 8 — Final Summary, Cleanup & On-Device Validation
|
|
156
|
+
|
|
157
|
+
19. **Display the complete workflow summary** — a "Life Sciences Cloud KAM Setup Complete" header, then one block per stage with actual values: (1) prerequisites confirmed; (2) objects/profiles/config records deployed, KAM & Sprint settings written, layouts + flexipages, 28 trigger handlers; (3) Territory Model `<model>` (Active) + Level-3 `<territory>`; (4) Participant Role `Rep Execution Specialist` + Sprint `<name>`; (5) Account + HCP, product master data, ProductTerritoryAvailability on `<territory>`, 2 Goal Definitions, ActionPlanTemplate `<name>` (Final) + 3 items + assignment, goals + template + 2 PATI shared to territory `<territory>`; (6) User `<name>` (`<username>`) on `LSC Custom Profile`, permsets Health Cloud Starter + Life Sciences Key Account Management + Life Sciences Field Sales Representative + Life Sciences Core, Territory `<territory>` (admin + KAM), mobile metadata cache generated. Close: "The org is ready for Life Sciences Cloud key account management workflows."
|
|
158
|
+
|
|
159
|
+
20. **Cleanup — delete the shared source folder ONCE.** After the final summary (all 6 stages complete), run from the CWD:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
rm -rf .lsc-starter-config
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Do this **silently** — do NOT print a cleanup line or mention the deletion. **Skip if the workflow stopped on a failure and the user may resume** — keep the folder so a resumed stage can still read it. This is the single deletion for the whole flow; child skills never delete it.
|
|
166
|
+
|
|
167
|
+
21. **Display the on-device (iPad) validation script and await confirmation.** Once the metadata cache is `Status='Active'` and the summary is shown, display the script **verbatim** from `references/stage-6-ipad-validation-script.md` (the login uses the Stage-6 KAM user's credentials), then **wait for the user to confirm** the on-device steps succeeded. Once confirmed, the setup is complete.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## State Tracking
|
|
172
|
+
|
|
173
|
+
Maintain overall orchestration state:
|
|
174
|
+
|
|
175
|
+
```text
|
|
176
|
+
OrchestrationState = {
|
|
177
|
+
targetOrg: string,
|
|
178
|
+
sourceFolderDownloaded: boolean, // downloaded in Phase 1, deleted in Phase 9
|
|
179
|
+
territoryId?: string, territoryName?: string, // captured in Stage 3, reused in Stages 5 & 6
|
|
180
|
+
stages: [
|
|
181
|
+
{ name: "Prerequisites", status: "pending|running|passed|failed|skipped" },
|
|
182
|
+
{ name: "StarterConfig", status: "pending|running|passed|failed" },
|
|
183
|
+
{ name: "TerritorySetup", status: "pending|running|passed|failed", territoryId?: string, territoryName?: string },
|
|
184
|
+
{ name: "ParticipantSprint", status: "pending|running|passed|failed", roleId?: string, sprintId?: string },
|
|
185
|
+
{ name: "DataAndPlanTemplates",status: "pending|running|passed|failed", accountId?: string, marketableProductId?: string, templateVersionId?: string },
|
|
186
|
+
{ name: "UserProvisioning", status: "pending|running|passed|failed", userId?: string, username?: string }
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Idempotent Stage Transitions & Mid-Flow Changes
|
|
194
|
+
|
|
195
|
+
Stages are **not re-entrant**. Before executing any stage, check its `status`: `running` → reply "Stage N is already in progress" and take no action; `passed` → ask explicit confirmation before re-running; `failed` → re-run (recovery); `pending` → advance. Set `running` at execution **start** (not on user input) so accidental double-confirms never run a stage twice.
|
|
196
|
+
|
|
197
|
+
If the user requests a change to an earlier stage's inputs **while a later stage is in progress/pending**, run an impact assessment first: acknowledge without applying, identify affected vs. unaffected stages, present options (re-run affected / apply forward only / cancel), and wait for the decision. Surface destructive-change warnings (an activated territory model can't be deleted; an existing user/records/published template remain).
|
|
198
|
+
|
|
199
|
+
The full behavior matrix, impact-assessment template, per-change impact mapping, and destructive-change warnings are in `references/state-machine-and-changes.md`.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Rules / Constraints
|
|
204
|
+
|
|
205
|
+
- **Org**: run Phase 0 org selection first; never silently reuse the default org.
|
|
206
|
+
- **Shared folder**: download `.lsc-starter-config/LSStarterConfig` exactly once (Phase 1 hard gate), delete it exactly once (Phase 9); child skills never touch it — Stages 2 and 5 read it, so proceeding without it fails downstream.
|
|
207
|
+
- **Order**: execute stages strictly 1→6, gating each on prior success; capture each stage's outputs (IDs, names) for later stages.
|
|
208
|
+
- **Territory invariant**: reuse the SAME Stage-3 level-3 territory (`OrchestrationState.territoryId`) for Stage 5 (ProductTerritoryAvailability) and Stage 6 (user alignment), or the KAM user sees no data.
|
|
209
|
+
- **Confirmation**: confirm only the fields each stage marks admin-confirmable; auto-derive the rest and show for confirmation.
|
|
210
|
+
- **Idempotency**: never re-execute a `running`/`passed` stage without confirmation (set `running` at execution start); impact-assess before applying mid-flow changes.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Gotchas
|
|
215
|
+
|
|
216
|
+
| Issue | Resolution |
|
|
217
|
+
|-------|------------|
|
|
218
|
+
| Source download fails in Phase 1 | Hard stop — do NOT run any stage. Fix the cause or download `.lsc-starter-config/LSStarterConfig` manually into the CWD, then re-run |
|
|
219
|
+
| No connected orgs found | Go straight to the fresh-org login (`sf org login web`) in Phase 0 |
|
|
220
|
+
| Artifacts exist from a prior run | Child skills/references are idempotent/upsert-safe — query to confirm, then skip or re-run |
|
|
221
|
+
| Stage re-triggered, or earlier input changed mid-flow | See `references/state-machine-and-changes.md` |
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Resume / Partial Re-run
|
|
226
|
+
|
|
227
|
+
If the user may have already completed some stages, ask which, then **verify each claimed-complete stage by querying the org** (1 = ask; 2 = `LSC Custom Profile`; 3 = active model + L3 territory; 4 = `ParticipantRole` + `Sprint`; 5 = Account + `ProductTerritoryAvailability` + `Final` version + assignment; 6 = `kam` user + permsets + territory), skip verified stages, and resume from the first incomplete one. Exact per-stage queries: `references/orchestration-flow.md` → Resume Logic.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Reference File Index
|
|
232
|
+
|
|
233
|
+
| File | When to read |
|
|
234
|
+
|------|-------------|
|
|
235
|
+
| `references/orchestration-flow.md` | At start — dependency diagram, gate + resume-detection queries, timing |
|
|
236
|
+
| `references/state-machine-and-changes.md` | On a re-triggered stage or a mid-flow input change |
|
|
237
|
+
| `references/stage-2-starter-config-overview.md` | Stage 2 — 13-step deploy + KAM/Sprint config records (points to sibling refs) |
|
|
238
|
+
| `references/stage-4-participant-role-and-sprint.md` | Stage 4 — participant role + sprint |
|
|
239
|
+
| `references/stage-5-data-and-plan-templates-overview.md` | Stage 5 — KAM data creation (Part A, points to its data ref) + goals, tasks, measures, action plan template (Part B) |
|
|
240
|
+
| `references/stage-6-user-provisioning-overview.md` | Stage 6 — user provisioning + metadata cache (points to sibling refs) |
|
|
241
|
+
| `references/stage-6-ipad-validation-script.md` | Final step — on-device (iPad) validation script shown after the metadata cache is Active |
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Orchestration Flow (KAM)
|
|
2
|
+
|
|
3
|
+
## Dependency Diagram
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
┌───────────────────────────────────────────────────────────────────┐
|
|
7
|
+
│ LIFE SCIENCES CLOUD KAM END-TO-END SETUP │
|
|
8
|
+
└───────────────────────────────────────────────────────────────────┘
|
|
9
|
+
|
|
10
|
+
Setup: download .lsc-starter-config/LSStarterConfig (coordinator, once)
|
|
11
|
+
│
|
|
12
|
+
▼
|
|
13
|
+
Stage 1: life-sciences-prerequisites-validate
|
|
14
|
+
├── Validates: org settings, permissions, OWD, features
|
|
15
|
+
├── Gate: All checks pass (or user explicitly skips)
|
|
16
|
+
└── Outputs: Confirmation that org is ready
|
|
17
|
+
│
|
|
18
|
+
▼
|
|
19
|
+
Stage 2: Starter Config Deploy (references/stage-2-starter-config-overview.md)
|
|
20
|
+
├── Deploys: StandardValueSets (10 confirmed), objects, profiles, config records
|
|
21
|
+
│ (incl. KAMSettings + SprintSettings), trigger handlers,
|
|
22
|
+
│ 4 KAM layouts, 6 KAM flexipages, application
|
|
23
|
+
├── Gate: LSC Custom Profile exists in org (query confirms)
|
|
24
|
+
└── Outputs: Profile ID; KAM/Sprint config records written
|
|
25
|
+
│
|
|
26
|
+
▼
|
|
27
|
+
Stage 3: life-sciences-territory-configure
|
|
28
|
+
├── Creates (or reuses) Territory Type, Territory Model, 3-level hierarchy
|
|
29
|
+
├── Activates: Territory Model (Planning → Active)
|
|
30
|
+
├── Gate: Model state = Active, Level-3 territory queryable
|
|
31
|
+
└── Outputs: Level-3 Territory2 ID + name ← reused in Stages 5 and 6
|
|
32
|
+
│
|
|
33
|
+
▼
|
|
34
|
+
Stage 4: Participant Role & Sprint (references/stage-4-participant-role-and-sprint.md)
|
|
35
|
+
├── Creates: ParticipantRole "Rep Execution Specialist", Sprint "Sprint 1 …"
|
|
36
|
+
├── Gate: ParticipantRole (IsActive) + Sprint (Not Started) exist
|
|
37
|
+
└── Outputs: Role ID, Sprint ID
|
|
38
|
+
│
|
|
39
|
+
▼
|
|
40
|
+
Stage 5: KAM Data & Plan Templates (references/stage-5-data-and-plan-templates-overview.md) — as ADMIN
|
|
41
|
+
├── Part A creates: Account, HealthcareProvider, ObjectTerritory2Association,
|
|
42
|
+
│ ProviderAcctTerritoryInfo, Product2, LifeSciMarketableProduct,
|
|
43
|
+
│ ContactPointAddress, ProductTerritoryAvailability (on Stage-3 territory)
|
|
44
|
+
├── Part B creates: 2 GoalDefinition, GoalDefinitionProduct, ActionPlanTemplate
|
|
45
|
+
│ (+ auto Version), 3 ActionPlanTemplateItem, ActionPlanTemplateAssignment;
|
|
46
|
+
│ publishes ActionPlanTemplate (status → Final);
|
|
47
|
+
│ shares goals + template + both PATI records to the leaf-territory Group
|
|
48
|
+
│ (2 GoalDefinitionShare + 1 ActionPlanTemplateShare + 2 ProviderAcctTerritoryInfoShare)
|
|
49
|
+
├── Gate: Account + LifeSciMarketableProduct + ProductTerritoryAvailability exist,
|
|
50
|
+
│ Final ActionPlanTemplateVersion + ActionPlanTemplateAssignment exist,
|
|
51
|
+
│ and the leaf-territory shares exist
|
|
52
|
+
└── Outputs: Account ID, LifeSciMarketableProduct ID, ActionPlanTemplateVersion ID
|
|
53
|
+
│
|
|
54
|
+
▼
|
|
55
|
+
Stage 6: KAM User Provisioning (references/stage-6-user-provisioning-overview.md)
|
|
56
|
+
├── Creates: Active user (username contains "kam") on LSC Custom Profile
|
|
57
|
+
├── Assigns: 4 permission sets (HealthCloudStarter, LifeSciencesKeyAccountManager, LifeSciencesFieldSalesRepresentative, LifeSciencesCore)
|
|
58
|
+
├── Assigns: KAM user + admin to the Stage-3 level-3 territory
|
|
59
|
+
├── Generates: mobile metadata cache (Connect API, admin)
|
|
60
|
+
├── Gate: user active, 4 permsets, territory assigned, metadata cache Active
|
|
61
|
+
└── Outputs: KAM username, login URL
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Gate Verification Queries
|
|
67
|
+
|
|
68
|
+
### After Stage 1 — Prerequisites
|
|
69
|
+
No automated query — the prerequisites skill produces a pass/fail table. Gate on all PASS or explicit user override.
|
|
70
|
+
|
|
71
|
+
### After Stage 2 — Starter Config
|
|
72
|
+
```bash
|
|
73
|
+
sf data query --query "SELECT Id, Name FROM Profile WHERE Name = 'LSC Custom Profile'" --target-org <org> --json
|
|
74
|
+
```
|
|
75
|
+
Expected: exactly 1 record.
|
|
76
|
+
|
|
77
|
+
### After Stage 3 — Territory
|
|
78
|
+
```bash
|
|
79
|
+
sf data query --query "SELECT Id, Name, DeveloperName, Territory2Model.State FROM Territory2 WHERE ParentTerritory2.ParentTerritory2Id != null AND Territory2Model.State = 'Active'" --target-org <org> --json
|
|
80
|
+
```
|
|
81
|
+
Expected: at least 1 record (the level-3 territory in an Active model). Capture its Id + Name.
|
|
82
|
+
|
|
83
|
+
### After Stage 4 — Participant Role & Sprint
|
|
84
|
+
```bash
|
|
85
|
+
sf data query --query "SELECT Id, DeveloperName, IsActive FROM ParticipantRole WHERE DeveloperName = 'Rep_Execution_Specialist'" --target-org <org> --json
|
|
86
|
+
sf data query --query "SELECT Id, Name, Status FROM Sprint ORDER BY CreatedDate DESC LIMIT 1" --target-org <org> --json
|
|
87
|
+
```
|
|
88
|
+
Expected: ParticipantRole `IsActive=true`; Sprint with `Status='Not Started'`.
|
|
89
|
+
|
|
90
|
+
### After Stage 5 — KAM Data & Plan Templates
|
|
91
|
+
|
|
92
|
+
Part A (data):
|
|
93
|
+
```bash
|
|
94
|
+
sf data query --query "SELECT Id FROM LifeSciMarketableProduct ORDER BY CreatedDate DESC LIMIT 1" --target-org <org> --json
|
|
95
|
+
sf data query --query "SELECT Id, ProductId, TerritoryId FROM ProductTerritoryAvailability ORDER BY CreatedDate DESC LIMIT 1" --target-org <org> --json
|
|
96
|
+
```
|
|
97
|
+
Expected: a LifeSciMarketableProduct and a ProductTerritoryAvailability on the Stage-3 territory. Capture the LifeSciMarketableProduct Id.
|
|
98
|
+
|
|
99
|
+
Part B (plan templates):
|
|
100
|
+
```bash
|
|
101
|
+
sf data query --query "SELECT Id, ActionPlanTemplateId, Status FROM ActionPlanTemplateVersion WHERE Status = 'Final' ORDER BY CreatedDate DESC LIMIT 1" --target-org <org> --json
|
|
102
|
+
sf data query --query "SELECT Id FROM ActionPlanTemplateAssignment ORDER BY CreatedDate DESC LIMIT 1" --target-org <org> --json
|
|
103
|
+
sf data query --query "SELECT Id, ParentId, UserOrGroupId FROM GoalDefinitionShare WHERE RowCause = 'Manual' ORDER BY CreatedDate DESC LIMIT 2" --target-org <org> --json
|
|
104
|
+
sf data query --query "SELECT Id, ParentId, UserOrGroupId FROM ActionPlanTemplateShare WHERE RowCause = 'Manual' ORDER BY CreatedDate DESC LIMIT 1" --target-org <org> --json
|
|
105
|
+
sf data query --query "SELECT Id, ParentId, UserOrGroupId FROM ProviderAcctTerritoryInfoShare WHERE RowCause = 'Manual' ORDER BY CreatedDate DESC LIMIT 2" --target-org <org> --json
|
|
106
|
+
```
|
|
107
|
+
Expected: a `Final` ActionPlanTemplateVersion, an ActionPlanTemplateAssignment, and the leaf-territory shares (2 GoalDefinitionShare + 1 ActionPlanTemplateShare + 2 ProviderAcctTerritoryInfoShare) whose `UserOrGroupId` is the Stage-3 territory Group.
|
|
108
|
+
|
|
109
|
+
### After Stage 6 — User Provisioning
|
|
110
|
+
```bash
|
|
111
|
+
sf data query --query "SELECT Id, Name, Username, Profile.Name, IsActive FROM User WHERE Username = '<username>'" --target-org <org> --json
|
|
112
|
+
sf data query --query "SELECT COUNT(Id) c FROM PermissionSetAssignment WHERE AssigneeId = '<userId>' AND PermissionSet.IsOwnedByProfile = false" --target-org <org> --json
|
|
113
|
+
sf data query --query "SELECT User.Name FROM UserTerritory2Association WHERE Territory2Id = '<territoryId>'" --target-org <org> --json
|
|
114
|
+
```
|
|
115
|
+
Expected: user `IsActive=true` on `LSC Custom Profile`; permset count **4**; ≥2 territory associations (KAM user + admin).
|
|
116
|
+
|
|
117
|
+
Confirm the metadata cache reached `Active`:
|
|
118
|
+
```bash
|
|
119
|
+
sf data query --query "SELECT Id, Status, LastModifiedDate FROM LifeSciMobileMetadataRecord ORDER BY LastModifiedDate DESC LIMIT 1" --target-org <org> --json
|
|
120
|
+
```
|
|
121
|
+
Expected: `Status='Active'` after the async job runs. `Inactive`, or stuck at `ValidationCompleted`, means failure — check `IntegrationErrorMessage` and Setup → Apex Jobs.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Resume Logic
|
|
126
|
+
|
|
127
|
+
When the user re-runs the orchestrator after a partial completion:
|
|
128
|
+
|
|
129
|
+
| Stage | How to detect completion | Query |
|
|
130
|
+
|------|------------------------|-------|
|
|
131
|
+
| 1 | Cannot detect programmatically | Ask user |
|
|
132
|
+
| 2 | Profile exists | `SELECT Id FROM Profile WHERE Name = 'LSC Custom Profile'` |
|
|
133
|
+
| 3 | Active model + L3 territory | `SELECT Id FROM Territory2 WHERE ParentTerritory2.ParentTerritory2Id != null AND Territory2Model.State = 'Active'` |
|
|
134
|
+
| 4 | Role + Sprint exist | `SELECT Id FROM ParticipantRole WHERE DeveloperName='Rep_Execution_Specialist'`; `SELECT Id FROM Sprint LIMIT 1` |
|
|
135
|
+
| 5 | Data + published template + territory shares exist | `SELECT Id FROM ProductTerritoryAvailability LIMIT 1`; `SELECT Id FROM ActionPlanTemplateVersion WHERE Status='Final' LIMIT 1`; `SELECT Id FROM ActionPlanTemplateShare WHERE RowCause='Manual' LIMIT 1` |
|
|
136
|
+
| 6 | KAM user exists | `SELECT Id FROM User WHERE Username LIKE '%kam%' AND Profile.Name = 'LSC Custom Profile'` |
|
|
137
|
+
|
|
138
|
+
If a stage is detected as complete, show the user what was found and ask: "Stage N appears complete (<evidence>). Skip it? (yes/no)"
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Timing Expectations
|
|
143
|
+
|
|
144
|
+
| Stage | Typical Duration | Notes |
|
|
145
|
+
|------|-----------------|-------|
|
|
146
|
+
| 1 - Prerequisites | 1-2 minutes | Read-only queries |
|
|
147
|
+
| 2 - Starter Config | 6-16 minutes | 13 deploy steps + SVS confirmations + KAM/Sprint config records |
|
|
148
|
+
| 3 - Territory Setup | 2-5 minutes | Interactive name confirmation + deploy + activation (or reuse) |
|
|
149
|
+
| 4 - Participant Role & Sprint | 1-2 minutes | 2 record creates + confirmation |
|
|
150
|
+
| 5 - Data & Plan Templates | 6-12 minutes | Part A: 8 object creates from CSVs (admin); Part B: goals, template, items, publish, assignment |
|
|
151
|
+
| 6 - User Provisioning | 3-6 minutes | User + permsets + territory + async metadata cache |
|
|
152
|
+
| **Total** | **19-43 minutes** | Depends on user interaction speed |
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Application FlexiPage Mapping Reference (KAM)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The application file at `.lsc-starter-config/LSStarterConfig/PackageComponents/applications/lsc4ce__lifeSciencesCommercial.app-meta.xml` contains both `<actionOverrides>` and `<profileActionOverrides>` that reference flexipages. After the KAM flexipages are deployed (Step 12), the application file must be updated to include only overrides for deployed pages.
|
|
6
|
+
|
|
7
|
+
## The Six KAM FlexiPages
|
|
8
|
+
|
|
9
|
+
For the KAM workflow, only these six flexipages are offered and confirmed with the user (see `stage-2-starter-config-overview.md`, Step 12):
|
|
10
|
+
|
|
11
|
+
| FlexiPage | pageOrSobjectType | Record Types |
|
|
12
|
+
|-----------|-------------------|--------------|
|
|
13
|
+
| Home_Page_LSC_Default | standard-home | — |
|
|
14
|
+
| LSCAccountHCP | Account | Business, Business_Account, Health_Care_Organization, PersonAccount.Health_Care_Provider, PersonAccount.PersonAccount, (none) |
|
|
15
|
+
| Contact_Point_Address_Record_Page | ContactPointAddress | — |
|
|
16
|
+
| Account_Plan_Objective_Record_Page3 | AccountPlanObjective | — |
|
|
17
|
+
| Account_Plan3 | AccountPlan | — |
|
|
18
|
+
| Goal_Definition1 | GoalDefinition | — |
|
|
19
|
+
|
|
20
|
+
## actionOverrides (keep as-is)
|
|
21
|
+
|
|
22
|
+
The `<actionOverrides>` section uses **managed package prefixed** content names (`lsc4ce__`). These are package-level overrides referencing managed-package flexipages that already exist; **retain them as-is** regardless of selection. The KAM-relevant ones:
|
|
23
|
+
|
|
24
|
+
| actionOverrides content | pageOrSobjectType | Corresponding deployable FlexiPage |
|
|
25
|
+
|------------------------|-------------------|-------------------------------------|
|
|
26
|
+
| lsc4ce__AccountHCP | Account | LSCAccountHCP |
|
|
27
|
+
| lsc4ce__Account_Plan | AccountPlan | Account_Plan3 |
|
|
28
|
+
| lsc4ce__Account_Plan_Objective_Record_Page | AccountPlanObjective | Account_Plan_Objective_Record_Page3 |
|
|
29
|
+
| lsc4ce__Goal_Definition | GoalDefinition | Goal_Definition1 |
|
|
30
|
+
|
|
31
|
+
## profileActionOverrides (filter to deployed pages)
|
|
32
|
+
|
|
33
|
+
The `<profileActionOverrides>` section uses **unmanaged** content names that directly correspond to deployable flexipages. Apply these rules:
|
|
34
|
+
|
|
35
|
+
1. **Keep** overrides where `<content>` matches a DEPLOYED (confirmed) flexipage name.
|
|
36
|
+
2. **Remove** overrides where `<content>` matches an UNSELECTED flexipage name.
|
|
37
|
+
3. Each selected flexipage generates overrides for BOTH profiles (LSC Custom Profile and Admin) and BOTH form factors (Small and Large).
|
|
38
|
+
4. Some flexipages have multiple record-type-specific overrides (e.g. `LSCAccountHCP`).
|
|
39
|
+
|
|
40
|
+
### Example: LSCAccountHCP profileActionOverrides block
|
|
41
|
+
|
|
42
|
+
```xml
|
|
43
|
+
<profileActionOverrides>
|
|
44
|
+
<actionName>View</actionName>
|
|
45
|
+
<content>LSCAccountHCP</content>
|
|
46
|
+
<formFactor>Large</formFactor>
|
|
47
|
+
<pageOrSobjectType>Account</pageOrSobjectType>
|
|
48
|
+
<recordType>Health_Care_Organization</recordType>
|
|
49
|
+
<type>Flexipage</type>
|
|
50
|
+
<profile>LSC Custom Profile</profile>
|
|
51
|
+
</profileActionOverrides>
|
|
52
|
+
```
|
|
53
|
+
Repeat per record type × form factor (Small/Large) × profile (LSC Custom Profile/Admin). Include the record-type variants listed in the table above plus the default (no `<recordType>`) entry.
|
|
54
|
+
|
|
55
|
+
### Home_Page_LSC_Default special case
|
|
56
|
+
|
|
57
|
+
The Home Page flexipage uses `actionName=Tab` (not `View`) and `pageOrSobjectType=standard-home`:
|
|
58
|
+
```xml
|
|
59
|
+
<profileActionOverrides>
|
|
60
|
+
<actionName>Tab</actionName>
|
|
61
|
+
<content>Home_Page_LSC_Default</content>
|
|
62
|
+
<formFactor>Large</formFactor>
|
|
63
|
+
<pageOrSobjectType>standard-home</pageOrSobjectType>
|
|
64
|
+
<type>Flexipage</type>
|
|
65
|
+
<profile>Admin</profile>
|
|
66
|
+
</profileActionOverrides>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Static Elements to Always Keep
|
|
70
|
+
|
|
71
|
+
These elements in the application file are NOT related to flexipages and must always be preserved:
|
|
72
|
+
- `<description>`, `<formFactors>`, `<isNav*>` settings, `<isOmniPinnedViewEnabled>`, `<label>`, `<navType>`, `<subscriberTabs>`, `<tabs>`, `<uiType>`, `<utilityBar>`
|
|
73
|
+
|
|
74
|
+
## Deploy Command
|
|
75
|
+
|
|
76
|
+
After updating the application file:
|
|
77
|
+
```bash
|
|
78
|
+
sf project deploy start --source-dir .lsc-starter-config/LSStarterConfig/PackageComponents/applications --target-org <org>
|
|
79
|
+
```
|
package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-deploy-commands.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Deploy Commands Reference
|
|
2
|
+
|
|
3
|
+
Exact CLI commands for each foundation deployment step. All commands use `--target-org <org>` where `<org>` is the user-provided org alias or username.
|
|
4
|
+
|
|
5
|
+
> **Working directory (required):** Run every `sf project deploy start` command from **inside the `.lsc-starter-config/LSStarterConfig/` project root** (the directory containing `sfdx-project.json`). `sf` searches the current directory and its ancestors — never its descendants — for `sfdx-project.json`, which pins `sourceApiVersion: 65.0`. If you run from a parent directory (or an unrelated repo), `sf` cannot find the project file, silently falls back to **API 60.0**, and profile deploys fail with `Property 'viewAllFields' not valid in version 60.0` (LSC profiles use 65.0-only permissions). The `.lsc-starter-config/LSStarterConfig/...` paths shown below are for readability — `cd` into `.lsc-starter-config/LSStarterConfig/` first and use paths relative to it (e.g. `PackageComponents/objects`).
|
|
6
|
+
|
|
7
|
+
## Step 1: StandardValueSets
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
sf project deploy start --source-dir .lsc-starter-config/LSStarterConfig/PackageComponents/standardValueSets --target-org <org>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Expected files deployed:
|
|
14
|
+
|
|
15
|
+
Generic Health-Cloud value sets:
|
|
16
|
+
- AccountRating.standardValueSet-meta.xml
|
|
17
|
+
- CPSSocialPlatformProvider.standardValueSet-meta.xml
|
|
18
|
+
- CareSpecialtySpecialtyType.standardValueSet-meta.xml
|
|
19
|
+
- CasePriority.standardValueSet-meta.xml
|
|
20
|
+
- CaseStatus.standardValueSet-meta.xml
|
|
21
|
+
- HProviderProviderClass.standardValueSet-meta.xml
|
|
22
|
+
- HProviderProviderType.standardValueSet-meta.xml
|
|
23
|
+
- HealthcareProviderStatus.standardValueSet-meta.xml
|
|
24
|
+
- InquiryTypeEnum.standardValueSet-meta.xml
|
|
25
|
+
- PAAffiliationRole.standardValueSet-meta.xml
|
|
26
|
+
|
|
27
|
+
KAM value sets (the ones confirmed with the admin before deploy — see Step 1 in `stage-2-starter-config-overview.md`). Confirmations A & B cover the first eight; `ActionPlanState` and `GoalAssignmentStatus` deploy with their shipped defaults (no prompt):
|
|
28
|
+
- StakeholderRoleType.standardValueSet-meta.xml
|
|
29
|
+
- StakeholderInfluenceLevel.standardValueSet-meta.xml
|
|
30
|
+
- StakeholderStrength.standardValueSet-meta.xml
|
|
31
|
+
- TerritoryBusinessPlanStatus.standardValueSet-meta.xml
|
|
32
|
+
- AccountPlanStatus.standardValueSet-meta.xml
|
|
33
|
+
- AccPlanObjectiveStatus.standardValueSet-meta.xml
|
|
34
|
+
- SprintStatus.standardValueSet-meta.xml
|
|
35
|
+
- AssessmentTaskCategory.standardValueSet-meta.xml
|
|
36
|
+
- ActionPlanState.standardValueSet-meta.xml
|
|
37
|
+
- GoalAssignmentStatus.standardValueSet-meta.xml
|
|
38
|
+
|
|
39
|
+
## Step 2: Objects
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
sf project deploy start --source-dir .lsc-starter-config/LSStarterConfig/PackageComponents/objects --target-org <org>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Deploys objects and their sub-components (recordTypes, compactLayouts, fieldSets, webLinks, businessProcesses):
|
|
46
|
+
- Account (recordTypes: Business, Business_Account, Health_Care_Organization; compactLayouts, fieldSets, webLinks)
|
|
47
|
+
- BusinessLicense (fieldSets)
|
|
48
|
+
- Case (recordTypes: Medical_Info_Request, Medical_Inquiry, Question; businessProcesses)
|
|
49
|
+
- HealthcareProvider (recordTypes: Health_Care_Organization, Health_Care_Provider)
|
|
50
|
+
- HealthcareProviderSpecialty (fieldSets)
|
|
51
|
+
- Inquiry (recordTypes: Adverse_Event, LSC_General, Medical_Inquiry; compactLayouts, fieldSets)
|
|
52
|
+
- InquiryQuestion (compactLayouts)
|
|
53
|
+
- InquiryQuestionAnswer (compactLayouts, fieldSets)
|
|
54
|
+
- PersonAccount (recordTypes: Health_Care_Provider, PersonAccount; compactLayouts)
|
|
55
|
+
- Product2 (recordTypes: LSC_Marketing_Item, LSC_Sample)
|
|
56
|
+
- ProviderAcctTerritoryInfo (recordTypes: Health_Care_Organization, Health_Care_Provider)
|
|
57
|
+
- ProviderVisitProdDiscussion (recordTypes: Patient_Tracking, Product_Feedback)
|
|
58
|
+
- User (fieldSets)
|
|
59
|
+
- Visit (compactLayouts, fieldSets)
|
|
60
|
+
|
|
61
|
+
## Step 3: Product Specification Types
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
sf project deploy start --source-dir .lsc-starter-config/LSStarterConfig/PackageComponents/productSpecificationTypes --target-org <org>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Files:
|
|
68
|
+
- LSPromotionalItem.productSpecificationType-meta.xml
|
|
69
|
+
- LSSampleProduct.productSpecificationType-meta.xml
|
|
70
|
+
|
|
71
|
+
## Step 4: Product Specification Record Types
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
sf project deploy start --source-dir .lsc-starter-config/LSStarterConfig/PackageComponents/productSpecificationRecTypes --target-org <org>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Files:
|
|
78
|
+
- LSC_Sample_LSSampleProduct.productSpecificationRecType-meta.xml
|
|
79
|
+
- LS_MarketingItem_LSPromotionalItem.productSpecificationRecType-meta.xml
|
|
80
|
+
|
|
81
|
+
## Step 5: Quick Actions
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
sf project deploy start --source-dir .lsc-starter-config/LSStarterConfig/PackageComponents/quickActions --target-org <org>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Files:
|
|
88
|
+
- Account.LogAVisit.quickAction-meta.xml
|
|
89
|
+
- Visit.Inquiry.quickAction-meta.xml
|
|
90
|
+
|
|
91
|
+
## Step 6: LSC Custom Profile (Skeleton)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
sf project deploy start --source-dir .lsc-starter-config/LSStarterConfig/PackageComponents/profiles/SkeletonProfile --target-org <org>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Deploys both skeleton profiles:
|
|
98
|
+
- LSC Custom Profile.profile-meta.xml
|
|
99
|
+
- Admin.profile-meta.xml
|
|
100
|
+
|
|
101
|
+
These are minimal profiles with field permissions and application visibility. Layout assignments and flexipage overrides are added later in Steps 11 and 13.
|
|
102
|
+
|
|
103
|
+
## Verifying Deployment Success
|
|
104
|
+
|
|
105
|
+
After each deploy command, check the output. A successful deployment shows:
|
|
106
|
+
```text
|
|
107
|
+
Deploy Succeeded.
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
If deployment fails, the output shows:
|
|
111
|
+
```text
|
|
112
|
+
Deploy Failed.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Capture the error message and component name for the recovery flow.
|
|
116
|
+
|
|
117
|
+
## Temporary Directory Pattern
|
|
118
|
+
|
|
119
|
+
For selective deploys (layouts, flexipages), create a temp directory structure **inside the SFDX project** (a `.lsc-deploy-tmp/` under the project root — never `/tmp` or any path outside the project), then remove it when done:
|
|
120
|
+
```bash
|
|
121
|
+
mkdir -p .lsc-deploy-tmp/<metadata-type>
|
|
122
|
+
cp <selected-files> .lsc-deploy-tmp/<metadata-type>/
|
|
123
|
+
sf project deploy start --source-dir .lsc-deploy-tmp --target-org <org>
|
|
124
|
+
rm -rf .lsc-deploy-tmp
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Alternatively, use `--metadata` flag with specific component names:
|
|
128
|
+
```bash
|
|
129
|
+
sf project deploy start --metadata "Layout:Account-HCO Account Layout" --metadata "Layout:Visit-LSC Visit Layout" --target-org <org>
|
|
130
|
+
```
|
|
131
|
+
</content>
|