@salesforce/afv-skills 1.59.0 → 1.61.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-architecture-analyze/SKILL.md +66 -17
- package/skills/agentforce-architecture-analyze/assets/cli/show_access_token.yaml +4 -7
- package/skills/agentforce-architecture-analyze/references/contract.json +1 -1
- package/skills/agentforce-architecture-analyze/scripts/emit_env.py +2 -2
- package/skills/agentforce-architecture-analyze/scripts/main.py +40 -44
- package/skills/agentforce-architecture-analyze/scripts/rest_client.py +11 -3
- package/skills/agentforce-architecture-analyze/scripts/sf_cli.py +77 -10
- package/skills/agentforce-architecture-analyze/scripts/tests/test_end_to_end_fixture.py +1 -0
- package/skills/agentforce-architecture-analyze/scripts/tests/test_flow_children_inflation.py +1 -0
- package/skills/agentforce-architecture-analyze/scripts/tests/test_main_pipeline.py +53 -2
- package/skills/agentforce-architecture-analyze/scripts/tests/test_resolve_creds.py +184 -36
- package/skills/agentforce-architecture-analyze/scripts/tests/test_rest_client.py +17 -0
- package/skills/agentforce-architecture-analyze/scripts/tests/test_sf_cli.py +165 -11
- package/skills/agentforce-architecture-analyze/scripts/tests/test_skill_md_pipeline_block.py +319 -0
- package/skills/agentforce-d360-analyze/SKILL.md +28 -10
- package/skills/agentforce-d360-analyze/scripts/dc.py +200 -50
- package/skills/agentforce-d360-analyze/scripts/discover_sessions.py +10 -6
- package/skills/agentforce-d360-analyze/scripts/fetch_dc.py +22 -6
- package/skills/agentforce-d360-analyze/scripts/resolve_session.py +21 -13
- package/skills/agentforce-d360-analyze/scripts/tests/test_dc_and_resolve_session.py +298 -76
- package/skills/agentforce-d360-analyze/scripts/tests/test_default_target_org.py +432 -0
- package/skills/agentforce-d360-analyze/scripts/tests/test_discover_sessions.py +1 -1
- package/skills/agentforce-d360-analyze/scripts/tests/test_resolve_session_main.py +9 -3
- package/skills/agentforce-d360-analyze/scripts/tests/test_skill_md_prefix_block.py +176 -0
- package/skills/consumer-goods-accruals-datakit-deploy/SKILL.md +17 -27
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/setup.js +7 -17
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/00-check-prerequisites.js +47 -63
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/01-download-static-resource.js +10 -13
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/02-replace-org-id.js +46 -46
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/03-deploy-metadata.js +4 -21
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/06-create-dataspace.js +58 -82
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/07-deploy-accruals-reports.js +16 -315
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/08-deploy-ui.js +9 -24
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/09-completion.js +44 -44
- package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/utils.js +11 -63
- package/skills/consumer-goods-rtr-datacloud-export-configure/SKILL.md +2 -1
- package/skills/consumer-goods-tpe-dashboard-configure/SKILL.md +2 -1
- package/skills/consumer-goods-tpe-dashboard-custom-kpi-configure/SKILL.md +2 -1
- package/skills/consumer-goods-tpe-datakit-deploy/SKILL.md +2 -1
- package/skills/data360-schema-get/SKILL.md +3 -3
- package/skills/design-systems-slds-validate/references/report-format.md +1 -1
- package/skills/dx-org-manage/SKILL.md +1 -0
- package/skills/dx-org-shape-manage/SKILL.md +1 -0
- package/skills/dx-org-snapshot-manage/SKILL.md +172 -0
- package/skills/dx-org-snapshot-manage/examples/create_error_output.json +16 -0
- package/skills/dx-org-snapshot-manage/examples/create_success_output.json +19 -0
- package/skills/dx-org-snapshot-manage/examples/delete_output.json +9 -0
- package/skills/dx-org-snapshot-manage/examples/get_output.json +19 -0
- package/skills/dx-org-snapshot-manage/examples/list_output.json +36 -0
- package/skills/dx-org-snapshot-manage/references/cli_flags.md +179 -0
- package/skills/dx-org-snapshot-manage/references/snapshot_usage.md +55 -0
- package/skills/dx-org-trial-expiration-check/SKILL.md +1 -1
- package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +2 -2
- package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +7 -5
- package/skills/education-cloud-student-recruitment-agent-configure/references/prerequisites.md +11 -11
- package/skills/experience-content-media-image-generate/SKILL.md +83 -0
- package/skills/experience-content-media-image-generate/scripts/download-image.sh +84 -0
- package/skills/external-diagram-mermaid-generate/SKILL.md +12 -12
- package/skills/field-service-data-capture-migrate/references/component-mapping.md +1 -1
- package/skills/field-service-data-capture-migrate/references/fsm-dc-capability-catalog.md +1 -2
- package/skills/field-service-data-capture-migrate/references/known-deploy-errors.md +1 -0
- package/skills/field-service-data-capture-migrate/references/transformer-rules.md +1 -1
- package/skills/field-service-data-capture-migrate/scripts/transform_flow.py +12 -1
- package/skills/field-service-data-capture-migrate/scripts/vendor/build_flow.py +4 -1
- package/skills/field-service-setup-orchestrator-get/SKILL.md +0 -1
- package/skills/insurance-brokerage-agency-billing-configure/SKILL.md +233 -0
- package/skills/insurance-brokerage-agency-billing-configure/references/accounting-setup.md +117 -0
- package/skills/insurance-brokerage-agency-billing-configure/references/billing-rules-config.md +237 -0
- package/skills/insurance-brokerage-agency-billing-configure/references/billing-settings.md +271 -0
- package/skills/insurance-brokerage-agency-billing-configure/references/demo-policy-config.md +138 -0
- package/skills/insurance-brokerage-agency-billing-configure/references/org-defaults.md +64 -0
- package/skills/insurance-brokerage-agency-billing-configure/references/permissions-config.md +226 -0
- package/skills/insurance-brokerage-agency-billing-configure/references/prerequisites.md +142 -0
- package/skills/life-sciences-fieldsalesrep-coordinate/SKILL.md +3 -2
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-execution-state-and-recovery.md +3 -3
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-overview.md +68 -45
- package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-visit-creation-data.md +17 -18
- package/skills/life-sciences-kam-coordinate/references/stage-5-data-and-plan-templates-overview.md +16 -3
- package/skills/life-sciences-kam-coordinate/references/stage-5-data-creation-data.md +16 -13
- package/skills/marketing-message-test/SKILL.md +194 -0
- package/skills/marketing-message-test/references/api-contract.md +333 -0
- package/skills/omnistudio-callable-apex-generate/SKILL.md +3 -3
- package/skills/omnistudio-datamapper-generate/SKILL.md +6 -6
- package/skills/omnistudio-datapacks-deploy/SKILL.md +11 -11
- package/skills/omnistudio-dependencies-analyze/SKILL.md +5 -5
- package/skills/omnistudio-epc-catalog-generate/SKILL.md +6 -6
- package/skills/omnistudio-flexcard-generate/SKILL.md +6 -6
- package/skills/omnistudio-integration-procedure-generate/SKILL.md +6 -6
- package/skills/omnistudio-omniscript-generate/SKILL.md +6 -5
- package/skills/platform-apex-logs-debug/SKILL.md +1 -0
- package/skills/platform-metadata-deploy/SKILL.md +1 -0
- package/skills/platform-models-api-configure/SKILL.md +5 -5
- package/skills/platform-soql-query/SKILL.md +1 -0
- package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +17 -6
- package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +107 -192
- package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/attach-milestone-action.json +6 -6
- package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +49 -20
- package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/output-templates.md +4 -4
- package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +224 -290
- package/skills/service-itsm-agentic-setup-incident-sla-configure/references/workflow.md +295 -0
- package/skills/service-itsm-incident-priority-configure/SKILL.md +1 -1
- package/skills/service-itsm-slack-itservice-configure/SKILL.md +2 -1
- package/skills/service-itsm-slack-itservice-configure/references/manage-slack-connection.md +2 -2
- package/skills/service-omni-channel-setup-coordinate/SKILL.md +20 -13
- package/skills/service-omni-channel-setup-coordinate/scripts/integration-driver.sh +5 -55
- package/skills/service-omni-channel-setup-coordinate/scripts/tests/test_omni_contracts.py +0 -38
- package/skills/service-omni-command-center-analyze/SKILL.md +2 -3
- package/skills/service-omni-command-center-analyze/scripts/analyze.sh +3 -3
- package/skills/tableau-next-asset-create/README.md +65 -0
- package/skills/tableau-next-asset-create/SKILL.md +409 -0
- package/skills/tableau-next-asset-create/references/admin-users.md +149 -0
- package/skills/tableau-next-asset-create/references/ai-readiness.md +355 -0
- package/skills/tableau-next-asset-create/references/alerts.md +111 -0
- package/skills/tableau-next-asset-create/references/build-workflow.md +819 -0
- package/skills/tableau-next-asset-create/references/dashboard-authoring.md +302 -0
- package/skills/tableau-next-asset-create/references/dashboard-design-principles.md +352 -0
- package/skills/tableau-next-asset-create/references/data-transform-gotchas.md +210 -0
- package/skills/tableau-next-asset-create/references/data-understanding.md +387 -0
- package/skills/tableau-next-asset-create/references/deep-reference-index.md +74 -0
- package/skills/tableau-next-asset-create/references/destructive-operations.md +62 -0
- package/skills/tableau-next-asset-create/references/edit-dashboard.md +273 -0
- package/skills/tableau-next-asset-create/references/edit-visualization.md +529 -0
- package/skills/tableau-next-asset-create/references/empty-source-handling.md +104 -0
- package/skills/tableau-next-asset-create/references/ingest-and-metric-gotchas.md +638 -0
- package/skills/tableau-next-asset-create/references/insight-bundle.md +69 -0
- package/skills/tableau-next-asset-create/references/large-flat-file-handling.md +331 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/_envelope.json +54 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/_shared-widget-fields.json +122 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/add_page.json +29 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/delete_page.json +27 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/discard_dashboard.json +11 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/move_widget.json +30 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/move_widget_to_page.json +30 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/place_widget_on_page.json +30 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/remove_widget_from_dashboard.json +16 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/remove_widget_from_page.json +26 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/rename_page.json +28 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/save_dashboard.json +18 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/undo.json +11 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_button_widget.json +69 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_container_widget.json +88 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_filter_widget.json +146 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_metric_widget.json +78 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_navigation_widget.json +80 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_parameter_widget.json +160 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_text_widget.json +103 -0
- package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_visualization_widget.json +68 -0
- package/skills/tableau-next-asset-create/references/sdm-tool-reference.md +721 -0
- package/skills/tableau-next-asset-create/references/semantic-query-and-enrichment.md +355 -0
- package/skills/tableau-next-asset-create/references/shared-gates.md +322 -0
- package/skills/tableau-next-asset-create/references/sharing-and-promotion.md +306 -0
- package/skills/tableau-next-asset-create/references/tasks/ai-readiness-audit.md +51 -0
- package/skills/tableau-next-asset-create/references/tasks/analyze-data.md +48 -0
- package/skills/tableau-next-asset-create/references/tasks/build-dashboard.md +66 -0
- package/skills/tableau-next-asset-create/references/tasks/build-end-to-end.md +73 -0
- package/skills/tableau-next-asset-create/references/tasks/create-data-transform.md +51 -0
- package/skills/tableau-next-asset-create/references/tasks/create-viz.md +58 -0
- package/skills/tableau-next-asset-create/references/tasks/edit-dashboard.md +80 -0
- package/skills/tableau-next-asset-create/references/tasks/edit-sdm.md +106 -0
- package/skills/tableau-next-asset-create/references/tasks/edit-viz.md +40 -0
- package/skills/tableau-next-asset-create/references/tasks/enrich-model.md +68 -0
- package/skills/tableau-next-asset-create/references/tasks/ingest-flat-file.md +68 -0
- package/skills/tableau-next-asset-create/references/tasks/manage-alert.md +35 -0
- package/skills/tableau-next-asset-create/references/tasks/profile-dataset.md +47 -0
- package/skills/tableau-next-asset-create/references/tasks/promote-or-reuse.md +46 -0
- package/skills/tableau-next-asset-create/references/tasks/provision-user.md +39 -0
- package/skills/tableau-next-asset-create/references/tasks/query-model.md +92 -0
- package/skills/tableau-next-asset-create/references/tasks/review-verified-questions.md +42 -0
- package/skills/tableau-next-asset-create/references/tasks/share-asset.md +37 -0
- package/skills/tableau-next-asset-create/references/verified-questions.md +125 -0
- package/skills/tableau-next-asset-create/references/viz-authoring.md +992 -0
- package/skills/service-de-channel-consent-configure/SKILL.md +0 -230
- package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/predefined-incident-policy.json +0 -102
package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-overview.md
CHANGED
|
@@ -67,46 +67,54 @@ Maintain a creation state throughout the workflow (target org, rep username/alia
|
|
|
67
67
|
|
|
68
68
|
3. **Verify the login** succeeded with `sf org display --target-org lsc-rep --json` and confirm the username matches the expected sales rep.
|
|
69
69
|
|
|
70
|
+
> **STOP-GATE — CSV-strict creation (MANDATORY; applies to every create in Steps 2–13).** Before creating any record for an object you MUST have `cat`-ed that object's CSV **this run** (`.lsc-starter-config/LSStarterConfig/Data/<object>.csv` — mapping in `references/stage-5-visit-creation-visit-creation-data.md`). Then:
|
|
71
|
+
> 1. **One record per data row.** Iterate every data row in the CSV; never create a single fixed record when the CSV holds more. The product CSVs (`product2.csv`, `lifescimarketableproduct.csv`, `productterritoryavailability.csv`, and the per-product detailing/discussion) in particular may carry **multiple rows** — creating only the first silently drops the rest.
|
|
72
|
+
> 2. **Build `--values` only from that row's columns.** Read each value from the live CSV cell. Do NOT paste values from this document, from the tables in `references/stage-5-visit-creation-visit-creation-data.md`, or from a prior run.
|
|
73
|
+
> 3. **Only these non-CSV values are permitted** (anything else = violation): (a) runtime FK IDs threaded from a prior step's create, (b) an org-resolved ID (`RecordTypeId` — including the Product2 RecordType resolved in the target org via `DeveloperName='LSC_Sample'`, whose CSV `RecordTypeId` is a foreign Id — `Territory2Id`, and the Product2/LifeSciMarketableProduct IDs in the product natural-key map — see Phase 3), (c) the generated `PlannedVisitStartTime` (Step 10, `NOW`).
|
|
74
|
+
> 4. **If a required CSV is absent → STOP** and report the missing file. Do NOT fall back to remembered or example values.
|
|
75
|
+
>
|
|
76
|
+
> The literal field values shown in the Step commands below are **placeholders for shape only** — intentionally not runnable data. Substitute the live CSV row. A **post-create reconciliation** (after Step 13) checks that records created per object == CSV data rows.
|
|
77
|
+
|
|
70
78
|
### Phase 2 — Create Account and Provider Records (Steps 2–6)
|
|
71
79
|
|
|
72
80
|
> **Rep vs. Admin ownership (important):** The LSC Custom Profile can create the Account, HealthcareProvider, ContactPointAddress, ProviderAcctTerritoryInfo, and the whole Visit chain (Steps 10–13) — but NOT territory associations (Step 5) or product master data (Steps 7–9). Create those as the admin (`--target-org <admin>`), then switch back to the rep. This split is expected: territory associations and products are admin-managed data.
|
|
73
81
|
|
|
74
|
-
**Step 2: Create Account (
|
|
82
|
+
**Step 2: Create Account (one per row in `account.csv`)**
|
|
75
83
|
|
|
76
|
-
|
|
84
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/account.csv` first. For each data row, resolve its `RecordType` DeveloperName to an ID:
|
|
77
85
|
```bash
|
|
78
|
-
sf data query --query "SELECT Id FROM RecordType WHERE SObjectType='Account' AND DeveloperName='
|
|
86
|
+
sf data query --query "SELECT Id FROM RecordType WHERE SObjectType='Account' AND DeveloperName='<row RecordType DeveloperName>'" --target-org lsc-rep --json
|
|
79
87
|
```
|
|
80
88
|
|
|
81
|
-
Then create
|
|
89
|
+
Then create **one Account per data row**, building `--values` only from that row's columns (map `RecordType` → resolved `RecordTypeId`):
|
|
82
90
|
```bash
|
|
83
|
-
sf data create record --sobject Account --values "
|
|
91
|
+
sf data create record --sobject Account --values "<one Col='row value' pair per account.csv column; RecordTypeId='<resolved>'>" --target-org lsc-rep --json
|
|
84
92
|
```
|
|
85
93
|
|
|
86
|
-
>
|
|
87
|
-
> The active flag is the standard `IsActive` field (boolean) — NOT `IsActive__c`. If the rep lacks FLS to it, omit it and have an admin set it afterward.
|
|
94
|
+
> Use only the row's live CSV values — never the illustrative names in `references/stage-5-visit-creation-visit-creation-data.md`.
|
|
88
95
|
|
|
89
|
-
**Step 3: Create HealthcareProvider**
|
|
96
|
+
**Step 3: Create HealthcareProvider (one per row in `healthcareprovider.csv`)**
|
|
90
97
|
|
|
91
98
|
First, query the HealthcareProvider RecordType ID:
|
|
92
99
|
```bash
|
|
93
100
|
sf data query --query "SELECT Id FROM RecordType WHERE SObjectType='HealthcareProvider' AND DeveloperName != null LIMIT 1" --target-org lsc-rep --json
|
|
94
101
|
```
|
|
95
102
|
|
|
96
|
-
|
|
103
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/healthcareprovider.csv`, then create **one HealthcareProvider per data row** (`AccountId` = the matching Account from Step 2, `RecordTypeId` = resolved):
|
|
97
104
|
```bash
|
|
98
|
-
sf data create record --sobject HealthcareProvider --values "
|
|
105
|
+
sf data create record --sobject HealthcareProvider --values "<one Col='row value' pair per healthcareprovider.csv column; AccountId='<accountId>' RecordTypeId='<hcpRecordTypeId>'>" --target-org lsc-rep --json
|
|
99
106
|
```
|
|
100
107
|
|
|
101
|
-
>
|
|
108
|
+
> Use only the row's live CSV values.
|
|
102
109
|
|
|
103
|
-
**Step 4: Create ContactPointAddress**
|
|
110
|
+
**Step 4: Create ContactPointAddress (one per row in `contactpointaddress.csv`)**
|
|
104
111
|
|
|
112
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/contactpointaddress.csv`, then create **one ContactPointAddress per data row** (`ParentId` = the matching Account from Step 2):
|
|
105
113
|
```bash
|
|
106
|
-
sf data create record --sobject ContactPointAddress --values "
|
|
114
|
+
sf data create record --sobject ContactPointAddress --values "<one Col='row value' pair per contactpointaddress.csv column; ParentId='<accountId>'>" --target-org lsc-rep --json
|
|
107
115
|
```
|
|
108
116
|
|
|
109
|
-
>
|
|
117
|
+
> Use only the row's live CSV values — never the illustrative address in `references/stage-5-visit-creation-visit-creation-data.md`.
|
|
110
118
|
|
|
111
119
|
**Step 5: Create ObjectTerritory2Association — as ADMIN**
|
|
112
120
|
|
|
@@ -115,91 +123,106 @@ First, query the level-3 territory ID:
|
|
|
115
123
|
sf data query --query "SELECT Id, Name FROM Territory2 WHERE Territory2Model.State='Active' AND ParentTerritory2.ParentTerritory2Id != null" --target-org <admin> --json
|
|
116
124
|
```
|
|
117
125
|
|
|
118
|
-
|
|
126
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/objectterritory2association.csv`, then create it **as the admin** — the rep profile lacks "Manage Territories", so as the rep this fails with `entity type cannot be inserted: Object Territory Association` (describe reports `createable=false` for the rep). As the admin it is `createable=true`. Create **one per data row** (`ObjectId` = the matching Account, `Territory2Id` = the queried level-3 territory):
|
|
119
127
|
```bash
|
|
120
|
-
sf data create record --sobject ObjectTerritory2Association --values "ObjectId='<accountId>' Territory2Id='<territory2Id>'
|
|
128
|
+
sf data create record --sobject ObjectTerritory2Association --values "<one Col='row value' pair per objectterritory2association.csv column; ObjectId='<accountId>' Territory2Id='<territory2Id>'>" --target-org <admin> --json
|
|
121
129
|
```
|
|
122
130
|
|
|
123
|
-
>
|
|
131
|
+
> Use only the row's live CSV values. This is an admin-managed record, not referenced by any later record (the Visit gets its territory from its own `TerritoryId`, Step 10; the account↔territory link is carried by ProviderAcctTerritoryInfo, Step 6). If admin access is unavailable, it may be skipped without breaking the visit.
|
|
124
132
|
|
|
125
|
-
**Step 6: Create ProviderAcctTerritoryInfo**
|
|
133
|
+
**Step 6: Create ProviderAcctTerritoryInfo (one per row in `provideracctterritoryinfo.csv`)**
|
|
126
134
|
|
|
135
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/provideracctterritoryinfo.csv`, then create **one per data row** (`AccountId` = matching Account, `Territory2Id` = queried level-3 territory, `PreferredAddressId` = the ContactPointAddress from Step 4):
|
|
127
136
|
```bash
|
|
128
|
-
sf data create record --sobject ProviderAcctTerritoryInfo --values "AccountId='<accountId>' Territory2Id='<territory2Id>' PreferredAddressId='<contactPointAddressId>'
|
|
137
|
+
sf data create record --sobject ProviderAcctTerritoryInfo --values "<one Col='row value' pair per provideracctterritoryinfo.csv column; AccountId='<accountId>' Territory2Id='<territory2Id>' PreferredAddressId='<contactPointAddressId>'>" --target-org lsc-rep --json
|
|
129
138
|
```
|
|
130
139
|
|
|
131
|
-
>
|
|
140
|
+
> Use only the row's live CSV values.
|
|
132
141
|
|
|
133
142
|
### Phase 3 — Create Product Records (Steps 7–9) — as ADMIN
|
|
134
143
|
|
|
135
144
|
Products are master data. The rep's LSC Custom Profile has NO create permission on `Product2` / `LifeSciMarketableProduct` (as the rep, even `Name` reports `createable=false` and `Product2.ProductCode` is not visible), and `ProductTerritoryAvailability` also fails as the rep. Create all three **as the admin** (`--target-org <admin>`). If your rep genuinely must own products, grant the profile Create + field access first — but the default and recommended path is admin.
|
|
136
145
|
|
|
137
|
-
**Step 7:
|
|
146
|
+
> **Product chain is multi-row — build a natural-key → ID map.** `product2.csv` may hold several products; each downstream row must resolve to the **correct** parent, not a single threaded ID. As you create Step 7 and Step 8 records, keep two lookup maps: **`ProductCode → Product2Id`** (from Step 7) and **`ProductCode (or Name) → LifeSciMarketableProductId`** (from Step 8). Steps 8, 9, and 12 use the CSV row's natural key (`ProductCode`/`Name`) to look up the right ID in these maps — never assume one product.
|
|
147
|
+
|
|
148
|
+
**Step 7: Create Product2 (one per row in `product2.csv`) — as ADMIN**
|
|
149
|
+
|
|
150
|
+
First, resolve the Product2 RecordType Id **in the target org** — the `RecordTypeId` in `product2.csv` is a foreign Id from the export org and must not be used:
|
|
151
|
+
```bash
|
|
152
|
+
sf data query --query "SELECT Id FROM RecordType WHERE SObjectType='Product2' AND DeveloperName='LSC_Sample'" --target-org <admin> --json
|
|
153
|
+
```
|
|
138
154
|
|
|
155
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/product2.csv`, then create **one Product2 per data row** (set `RecordTypeId` = the resolved `LSC_Sample` Id, NOT the CSV's foreign value); record each `ProductCode → Product2Id` in the map:
|
|
139
156
|
```bash
|
|
140
|
-
sf data create record --sobject Product2 --values "
|
|
157
|
+
sf data create record --sobject Product2 --values "<one Col='row value' pair per product2.csv column except RecordTypeId; RecordTypeId='<resolved LSC_Sample Id>'>" --target-org <admin> --json
|
|
141
158
|
```
|
|
142
159
|
|
|
143
|
-
>
|
|
160
|
+
> Use only the row's live CSV values, except `RecordTypeId` — that is the org-resolved `LSC_Sample` Id; the CSV's `RecordTypeId` column is a foreign Id and must be ignored.
|
|
144
161
|
|
|
145
|
-
**Step 8: Create LifeSciMarketableProduct — as ADMIN**
|
|
162
|
+
**Step 8: Create LifeSciMarketableProduct (one per row in `lifescimarketableproduct.csv`) — as ADMIN**
|
|
146
163
|
|
|
164
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/lifescimarketableproduct.csv`, then create **one per data row**; set `ProductId` by looking up the row's product natural key in the Step 7 map. Record each `ProductCode`/`Name` → `LifeSciMarketableProductId` in the map:
|
|
147
165
|
```bash
|
|
148
|
-
sf data create record --sobject LifeSciMarketableProduct --values "
|
|
166
|
+
sf data create record --sobject LifeSciMarketableProduct --values "<one Col='row value' pair per lifescimarketableproduct.csv column; ProductId='<matched product2Id>'>" --target-org <admin> --json
|
|
149
167
|
```
|
|
150
168
|
|
|
151
|
-
>
|
|
169
|
+
> Use only the row's live CSV values.
|
|
152
170
|
|
|
153
|
-
**Step 9: Create ProductTerritoryAvailability — as ADMIN**
|
|
171
|
+
**Step 9: Create ProductTerritoryAvailability (one per row in `productterritoryavailability.csv`) — as ADMIN**
|
|
154
172
|
|
|
173
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/productterritoryavailability.csv`, then create **one per data row**; set `ProductId` from the Step 8 LifeSciMarketableProduct map (matched on the row's product natural key), `TerritoryId` = queried level-3 territory:
|
|
155
174
|
```bash
|
|
156
|
-
sf data create record --sobject ProductTerritoryAvailability --values "
|
|
175
|
+
sf data create record --sobject ProductTerritoryAvailability --values "<one Col='row value' pair per productterritoryavailability.csv column; ProductId='<matched lifeSciMarketableProductId>' TerritoryId='<territory2Id>'>" --target-org <admin> --json
|
|
157
176
|
```
|
|
158
177
|
|
|
159
|
-
>
|
|
178
|
+
> Use only the row's live CSV values. After Step 9, switch back to the rep (`--target-org lsc-rep`) for the Visit chain (Steps 10–13) so the visit records are rep-owned.
|
|
160
179
|
|
|
161
180
|
### Phase 4 — Create Visit Records (Steps 10–13)
|
|
162
181
|
|
|
163
182
|
> **STOP-GATE (chain integrity).** Steps 10–13 are a strict dependency chain — each `sf data create record` returns an `id` that is a required input to the next step. After **every** create in this stage (Steps 2–13), confirm the response has `"success": true` and capture the real returned `id`. If any create fails, **STOP immediately** — do NOT continue with a null, empty, or placeholder ID (that produces an orphaned or mis-parented record chain that looks created but is broken). Report which step failed and its error. After Step 13, verify the full chain resolves: the ProviderVisitProdDiscussion → ProviderVisitProdDetailing → ProviderVisit → Visit → Account links must all be non-null.
|
|
164
183
|
|
|
165
|
-
**Step 10: Create Visit (PlannedVisitStartTime = NOW)**
|
|
184
|
+
**Step 10: Create Visit (one per row in `visit.csv`; PlannedVisitStartTime = NOW)**
|
|
166
185
|
|
|
186
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/visit.csv`, then create **one Visit per data row** (`AccountId` = matching Account, `PlaceId` = ContactPointAddress from Step 4, `TerritoryId` = queried level-3 territory):
|
|
167
187
|
```bash
|
|
168
|
-
sf data create record --sobject Visit --values "AccountId='<accountId>' PlaceId='<contactPointAddressId>'
|
|
188
|
+
sf data create record --sobject Visit --values "<one Col='row value' pair per visit.csv column; AccountId='<accountId>' PlaceId='<contactPointAddressId>' TerritoryId='<territory2Id>' PlannedVisitStartTime='<NOW_ISO8601>'>" --target-org lsc-rep --json
|
|
169
189
|
```
|
|
170
190
|
|
|
171
|
-
> `<NOW_ISO8601>` = current datetime in ISO 8601 (e.g. `2026-08-01T10:30:00.000+0000`), generated at execution time with `date -u +"%Y-%m-%dT%H:%M:%S.000+0000"`.
|
|
172
|
-
>
|
|
173
|
-
> Reference: `visit.csv` — Status=Planned, linked to Account, Place, and Territory
|
|
191
|
+
> `<NOW_ISO8601>` = current datetime in ISO 8601 (e.g. `2026-08-01T10:30:00.000+0000`), generated at execution time with `date -u +"%Y-%m-%dT%H:%M:%S.000+0000"`. Keep `PlannedVisitStartTime` = NOW even if the CSV carries a date — a past date risks the visit not syncing to the iPad app. Use only the row's live CSV values for the other columns.
|
|
174
192
|
|
|
175
|
-
**Step 11: Create ProviderVisit**
|
|
193
|
+
**Step 11: Create ProviderVisit (one per row in `providervisit.csv`)**
|
|
176
194
|
|
|
177
195
|
First, query the territory name:
|
|
178
196
|
```bash
|
|
179
197
|
sf data query --query "SELECT Name FROM Territory2 WHERE Id='<territory2Id>'" --target-org lsc-rep --json
|
|
180
198
|
```
|
|
181
199
|
|
|
182
|
-
|
|
200
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/providervisit.csv`, then create **one per data row** (`VisitId` = the matching Visit from Step 10; `TerritoryName` = the queried territory Name):
|
|
183
201
|
```bash
|
|
184
|
-
sf data create record --sobject ProviderVisit --values "VisitId='<visitId>' TerritoryName='<territoryName>'
|
|
202
|
+
sf data create record --sobject ProviderVisit --values "<one Col='row value' pair per providervisit.csv column; VisitId='<visitId>' TerritoryName='<territoryName>'>" --target-org lsc-rep --json
|
|
185
203
|
```
|
|
186
204
|
|
|
205
|
+
> Use only the row's live CSV values.
|
|
187
206
|
|
|
188
|
-
**Step 12: Create ProviderVisitProdDetailing**
|
|
207
|
+
**Step 12: Create ProviderVisitProdDetailing (one per row in `providervisitproddetailing.csv`)**
|
|
189
208
|
|
|
209
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/providervisitproddetailing.csv`, then create **one per data row** (`ProviderVisitId` = the matching ProviderVisit from Step 11; `ProductId` = the LifeSciMarketableProduct from the Step 8 map, matched on the row's product natural key):
|
|
190
210
|
```bash
|
|
191
|
-
sf data create record --sobject ProviderVisitProdDetailing --values "ProviderVisitId='<providerVisitId>' ProductId='<lifeSciMarketableProductId>'
|
|
211
|
+
sf data create record --sobject ProviderVisitProdDetailing --values "<one Col='row value' pair per providervisitproddetailing.csv column; ProviderVisitId='<providerVisitId>' ProductId='<matched lifeSciMarketableProductId>'>" --target-org lsc-rep --json
|
|
192
212
|
```
|
|
193
213
|
|
|
194
|
-
>
|
|
214
|
+
> Use only the row's live CSV values.
|
|
195
215
|
|
|
196
|
-
**Step 13: Create ProviderVisitProdDiscussion**
|
|
216
|
+
**Step 13: Create ProviderVisitProdDiscussion (one per row in `providervisitproddiscussion.csv`)**
|
|
197
217
|
|
|
218
|
+
`cat .lsc-starter-config/LSStarterConfig/Data/providervisitproddiscussion.csv`, then create **one per data row** (`ProviderVisitProductDtlId` = the matching ProviderVisitProdDetailing from Step 12):
|
|
198
219
|
```bash
|
|
199
|
-
sf data create record --sobject ProviderVisitProdDiscussion --values "
|
|
220
|
+
sf data create record --sobject ProviderVisitProdDiscussion --values "<one Col='row value' pair per providervisitproddiscussion.csv column; ProviderVisitProductDtlId='<providerVisitProdDetailingId>'>" --target-org lsc-rep --json
|
|
200
221
|
```
|
|
201
222
|
|
|
202
|
-
>
|
|
223
|
+
> Use only the row's live CSV values.
|
|
224
|
+
|
|
225
|
+
> **STOP-GATE — post-create reconciliation (MANDATORY, after Step 13).** For **every** object created in Steps 2–13, the number of records created this run MUST equal the number of **data rows** in that object's CSV. Compare per object (e.g. Products created == data rows in `product2.csv`; ProviderVisitProdDetailing created == rows in `providervisitproddetailing.csv`). If any count is short — most commonly only the first product row was created and the rest silently dropped — **STOP** and report the object, expected row count, and actual created count; do NOT proceed to Phase 5. This catches the "created 1 of N" regression that the per-row rule in the CSV-strict STOP-GATE (Phase 1) is meant to prevent.
|
|
203
226
|
|
|
204
227
|
### Phase 5 — Generate Metadata Cache (Steps 14–15) — as ADMIN
|
|
205
228
|
|
|
@@ -277,14 +300,14 @@ Load-bearing rules (full table with rationales in `references/stage-5-visit-crea
|
|
|
277
300
|
- **Ask for rep credentials — never assume or reuse admin credentials.**
|
|
278
301
|
- Create records in exact order 2→15, then run the manual iPad validation (Step 16) last; earlier IDs feed later records and the metadata cache must exist before the app can sync the Visit.
|
|
279
302
|
- **Step 16 is manual** — show rep credentials (ask for the password if unknown; never use admin creds), give instructions, and never claim it's done without the user's explicit "yes"; on a reported issue, run the troubleshooting checks before re-asking.
|
|
280
|
-
- `PlannedVisitStartTime` must be NOW; Product2
|
|
303
|
+
- `PlannedVisitStartTime` must be NOW; Product2's `RecordTypeId` is org-resolved via `DeveloperName='LSC_Sample'` (the CSV value is a foreign Id — ignore it).
|
|
281
304
|
- Show diagnosis on every failure and wait for the user's decision — no silent skips.
|
|
282
305
|
|
|
283
306
|
---
|
|
284
307
|
|
|
285
308
|
## Gotchas
|
|
286
309
|
|
|
287
|
-
Common failures and fixes — missing RecordTypes/objects, rep-vs-admin
|
|
310
|
+
Common failures and fixes — missing RecordTypes/objects, rep-vs-admin create permission on territory associations and product master data, ISO 8601 date formats, the Step 14 profile/metadata prerequisites, and the Step 15 Connect API errors — are tabulated in `references/stage-5-visit-creation-execution-state-and-recovery.md`.
|
|
288
311
|
|
|
289
312
|
---
|
|
290
313
|
|
|
@@ -29,19 +29,19 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
29
29
|
|
|
30
30
|
## Account (RecordType: Health_Care_Provider)
|
|
31
31
|
|
|
32
|
-
| Field |
|
|
32
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
33
33
|
|-------|-------|--------|
|
|
34
34
|
| FirstName | Aaron | account.csv |
|
|
35
35
|
| LastName | Morita | account.csv |
|
|
36
36
|
| Salutation | Dr. | account.csv |
|
|
37
37
|
| RecordType DeveloperName | Health_Care_Provider | account.csv |
|
|
38
|
-
| IsActive | True | account.csv
|
|
38
|
+
| IsActive | True | account.csv |
|
|
39
39
|
|
|
40
|
-
> Created as the **rep** (`--target-org lsc-rep`).
|
|
40
|
+
> Created as the **rep** (`--target-org lsc-rep`).
|
|
41
41
|
|
|
42
42
|
## HealthcareProvider
|
|
43
43
|
|
|
44
|
-
| Field |
|
|
44
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
45
45
|
|-------|-------|--------|
|
|
46
46
|
| Name | Aaron Morita HP | healthcareprovider.csv |
|
|
47
47
|
| IsActive | True | healthcareprovider.csv |
|
|
@@ -50,11 +50,9 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
50
50
|
| Status | Active | healthcareprovider.csv |
|
|
51
51
|
| AccountId | (from Step 2) | FK |
|
|
52
52
|
|
|
53
|
-
> Do NOT set `NationalProviderIdentifier` or `IsSpeaker` on creation. Both — along with `IsActive` — are gated by field-level security on the LSC Custom Profile; if the rep lacks FLS the create fails. `IsSpeaker` and `NationalProviderIdentifier` are not required for the visit, so omit them (an admin can set them later). The CSV lists them because it was exported from an org where the profile had FLS to those fields.
|
|
54
|
-
|
|
55
53
|
## ContactPointAddress
|
|
56
54
|
|
|
57
|
-
| Field |
|
|
55
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
58
56
|
|-------|-------|--------|
|
|
59
57
|
| Name | 415 Mission St | contactpointaddress.csv |
|
|
60
58
|
| AddressType | Billing | contactpointaddress.csv |
|
|
@@ -74,7 +72,7 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
74
72
|
|
|
75
73
|
## ObjectTerritory2Association
|
|
76
74
|
|
|
77
|
-
| Field |
|
|
75
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
78
76
|
|-------|-------|--------|
|
|
79
77
|
| ObjectId | (from Step 2 — Account) | FK |
|
|
80
78
|
| Territory2Id | (queried — level-3 territory) | FK |
|
|
@@ -84,7 +82,7 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
84
82
|
|
|
85
83
|
## ProviderAcctTerritoryInfo
|
|
86
84
|
|
|
87
|
-
| Field |
|
|
85
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
88
86
|
|-------|-------|--------|
|
|
89
87
|
| AccountId | (from Step 2) | FK |
|
|
90
88
|
| Territory2Id | (queried — level-3 territory) | FK |
|
|
@@ -94,20 +92,21 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
94
92
|
| IsTargetedAccount | True | provideracctterritoryinfo.csv |
|
|
95
93
|
| SourceType | Manual | provideracctterritoryinfo.csv |
|
|
96
94
|
|
|
97
|
-
## Product2
|
|
95
|
+
## Product2
|
|
98
96
|
|
|
99
|
-
| Field |
|
|
97
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
100
98
|
|-------|-------|--------|
|
|
101
99
|
| Name | Immunexis 5mg | product2.csv |
|
|
102
100
|
| ProductCode | IM001-5 | product2.csv |
|
|
103
101
|
| IsActive | True | product2.csv |
|
|
102
|
+
| RecordTypeId | (resolve in the target org: `RecordType` `DeveloperName='LSC_Sample'`) | product2.csv holds a **foreign** Id — ignore it; use the resolved target-org Id |
|
|
104
103
|
|
|
105
|
-
>
|
|
104
|
+
> `RecordTypeId`: the value in `product2.csv` comes from the export org and is not valid here. Query the target org for the `Product2` RecordType with `DeveloperName='LSC_Sample'` and use that Id.
|
|
106
105
|
> Create as **admin** — the rep profile has no create permission on Product2 (`Name` is `createable=false`, `ProductCode` invisible for the rep). Steps 7–9 (Product2, LifeSciMarketableProduct, ProductTerritoryAvailability) are all admin-owned master data.
|
|
107
106
|
|
|
108
107
|
## LifeSciMarketableProduct
|
|
109
108
|
|
|
110
|
-
| Field |
|
|
109
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
111
110
|
|-------|-------|--------|
|
|
112
111
|
| Name | Immunexis 5mg | lifescimarketableproduct.csv |
|
|
113
112
|
| ProductId | (from Step 7 — Product2) | FK |
|
|
@@ -122,7 +121,7 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
122
121
|
|
|
123
122
|
## ProductTerritoryAvailability
|
|
124
123
|
|
|
125
|
-
| Field |
|
|
124
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
126
125
|
|-------|-------|--------|
|
|
127
126
|
| ProductId | (from Step 8 — LifeSciMarketableProduct) | FK |
|
|
128
127
|
| TerritoryId | (queried — level-3 territory) | FK |
|
|
@@ -133,7 +132,7 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
133
132
|
|
|
134
133
|
## Visit
|
|
135
134
|
|
|
136
|
-
| Field |
|
|
135
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
137
136
|
|-------|-------|--------|
|
|
138
137
|
| AccountId | (from Step 2) | FK |
|
|
139
138
|
| PlaceId | (from Step 4 — ContactPointAddress) | FK |
|
|
@@ -143,7 +142,7 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
143
142
|
|
|
144
143
|
## ProviderVisit
|
|
145
144
|
|
|
146
|
-
| Field |
|
|
145
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
147
146
|
|-------|-------|--------|
|
|
148
147
|
| VisitId | (from Step 10) | FK |
|
|
149
148
|
| TerritoryName | (queried territory Name) | providervisit.csv |
|
|
@@ -151,7 +150,7 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
151
150
|
|
|
152
151
|
## ProviderVisitProdDetailing
|
|
153
152
|
|
|
154
|
-
| Field |
|
|
153
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
155
154
|
|-------|-------|--------|
|
|
156
155
|
| ProviderVisitId | (from Step 11) | FK |
|
|
157
156
|
| ProductId | (from Step 8 — LifeSciMarketableProduct) | FK |
|
|
@@ -161,7 +160,7 @@ Each object maps to a CSV named for the sobject (lowercased) under `.lsc-starter
|
|
|
161
160
|
|
|
162
161
|
## ProviderVisitProdDiscussion
|
|
163
162
|
|
|
164
|
-
| Field |
|
|
163
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
165
164
|
|-------|-------|--------|
|
|
166
165
|
| ProviderVisitProductDtlId | (from Step 12) | FK |
|
|
167
166
|
| Note | Discussed Oncology treatments and patient care approaches | providervisitproddiscussion.csv |
|
package/skills/life-sciences-kam-coordinate/references/stage-5-data-and-plan-templates-overview.md
CHANGED
|
@@ -33,7 +33,16 @@ All Part A CSVs come from `.lsc-starter-config/LSStarterConfig/Data/`. This stag
|
|
|
33
33
|
|
|
34
34
|
## Workflow
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
> **CSV-STRICT STOP-GATE (MANDATORY — do this before any `sf data create record` in Part A).** For each of the 8 CSV objects (Account, HealthcareProvider, ContactPointAddress, ObjectTerritory2Association, ProviderAcctTerritoryInfo, Product2, LifeSciMarketableProduct, ProductTerritoryAvailability) you MUST have `cat`-ed that object's `.lsc-starter-config/LSStarterConfig/Data/<object>.csv` **this run** and built `--values` **strictly from the row's columns** — one record per data row. If a CSV is absent, STOP and report it must be provisioned by the coordinator; do NOT fall back to remembered or reference-table values. The only values permitted that are **not** a literal CSV column are the closed set below — anything else is a violation.
|
|
37
|
+
>
|
|
38
|
+
> **Closed set of permitted non-CSV values** (Part A CSV objects only):
|
|
39
|
+
> 1. **Runtime FK Ids** threaded from a prior create in this run (AccountId, ParentId, ProductId, PreferredAddressId, …).
|
|
40
|
+
> 2. **Org-resolved lookup Ids from a CSV natural key** — the `Product2` `RecordTypeId` resolved in the target org via `RecordType WHERE SObjectType='Product2' AND DeveloperName='LSC_Sample'` (the CSV's `RecordTypeId` is a foreign Id from the export org — ignore it), and the product natural-key→Id map (key on `ProductCode`/`Name`) so each `LifeSciMarketableProduct`/`ProductTerritoryAvailability` row resolves its correct parent product.
|
|
41
|
+
> 3. **The Stage-3 level-3 `territoryId`** (from `OrchestrationState.territoryId`) for `ObjectTerritory2Association.Territory2Id`, `ProviderAcctTerritoryInfo.Territory2Id`, and `ProductTerritoryAvailability.TerritoryId`.
|
|
42
|
+
>
|
|
43
|
+
> The **HCO "Partners Healthcare" bundle** below is a separate, intentional exception (explicit hardcoded values + its own `Health_Care_Organization` record types) — it is not one of these 8 CSV objects and this gate does not apply to it.
|
|
44
|
+
|
|
45
|
+
1. **Read the live CSV for each object** — never hardcode values from the reference table; build `--values` from the row's columns at execution time. **Loop one record per CSV data row** — the product chain (`product2.csv`, `lifescimarketableproduct.csv`, `productterritoryavailability.csv`) may be multi-row, so create every row and thread the correct parent per row via the product natural-key→Id map (do not create just the first). Full field-by-field mapping: `references/stage-5-data-creation-data.md`.
|
|
37
46
|
2. **Create the records in dependency order**, capturing each returned Id for downstream foreign keys:
|
|
38
47
|
|
|
39
48
|
```text
|
|
@@ -59,6 +68,8 @@ sf data query --query "SELECT Id, ProductId, TerritoryId FROM ProductTerritoryAv
|
|
|
59
68
|
|
|
60
69
|
All three must return a record, and the `ProductTerritoryAvailability.TerritoryId` must equal the Stage-3 `territoryId`.
|
|
61
70
|
|
|
71
|
+
**Reconciliation (MANDATORY).** For each of the 8 CSV objects, the number of records created this run must equal the data-row count in that object's CSV. The product chain (`product2.csv`, `lifescimarketableproduct.csv`, `productterritoryavailability.csv`) is potentially multi-row — verify none were dropped. If any count is short, STOP before Part B and report object / expected / actual; do not proceed with a partial data set.
|
|
72
|
+
|
|
62
73
|
## Part A Rules / Constraints
|
|
63
74
|
|
|
64
75
|
| Constraint | Rationale |
|
|
@@ -66,6 +77,8 @@ All three must return a record, and the `ProductTerritoryAvailability.TerritoryI
|
|
|
66
77
|
| Create everything as the admin | No end user exists until Stage 6 |
|
|
67
78
|
| Do NOT create the Visit chain | KAM workflow has no visit data |
|
|
68
79
|
| Read the live CSV; never hardcode | CSV values may change between runs |
|
|
80
|
+
| **Build `--values` strictly from the row's CSV columns; only these non-CSV values are permitted** — (a) runtime FK Ids threaded from a prior create, (b) an org-resolved lookup Id from a CSV natural key (the `Product2` `RecordTypeId` via `DeveloperName='LSC_Sample'`, whose CSV value is a foreign Id, and the product natural-key→Id map), (c) the Stage-3 `territoryId`. Anything else is a violation. On recovery, re-`cat` the CSV — never resume from remembered/hardcoded values | The closed set keeps every field either CSV-sourced or a documented runtime/resolved Id; recovery must not reintroduce literals |
|
|
81
|
+
| **Post-create reconciliation:** for each of the 8 CSV objects, records created this run == data rows in that object's CSV (the product chain is multi-row — verify none dropped); if short, STOP before Part B | Catches the "created 1 of N products" regression where only the first row is created |
|
|
69
82
|
| Use the Stage-3 level-3 territory for all three territory FKs | The KAM user (Stage 6) is assigned this same territory; a mismatch hides all data |
|
|
70
83
|
| Do NOT download or delete `.lsc-starter-config/` | Owned by the coordinator |
|
|
71
84
|
|
|
@@ -74,8 +87,8 @@ All three must return a record, and the `ProductTerritoryAvailability.TerritoryI
|
|
|
74
87
|
| Issue | Resolution |
|
|
75
88
|
|-------|------------|
|
|
76
89
|
| `ProductTerritoryAvailability` created against the wrong territory | Re-create with `TerritoryId` = the Stage-3 `territoryId` (the one Stage 6 assigns to the user) |
|
|
77
|
-
| Product2 create fails on `RecordTypeId` |
|
|
78
|
-
| A create fails on
|
|
90
|
+
| Product2 create fails on `RecordTypeId` | The value in `product2.csv` is a **foreign** Id from the export org — ignore it. Resolve the target org's `Product2` RecordType via `RecordType WHERE SObjectType='Product2' AND DeveloperName='LSC_Sample'` and set that Id |
|
|
91
|
+
| A create fails on a field | Omit the offending non-required field and continue (see the per-object notes in the data reference) |
|
|
79
92
|
| `INVALID_CROSS_REFERENCE_KEY` on an FK | The parent record Id wasn't captured — re-query the parent and retry |
|
|
80
93
|
|
|
81
94
|
---
|
|
@@ -27,17 +27,17 @@ The CSVs come from <https://github.com/SalesforceLabs/LSStarterConfig.git>. As a
|
|
|
27
27
|
|
|
28
28
|
This is the CSV-driven **person** account (an individual provider). The HCO (organization) account is a separate bundle below.
|
|
29
29
|
|
|
30
|
-
| Field |
|
|
30
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
31
31
|
|-------|-------|--------|
|
|
32
32
|
| FirstName | Aaron | account.csv |
|
|
33
33
|
| LastName | Morita | account.csv |
|
|
34
34
|
| Salutation | Dr. | account.csv |
|
|
35
35
|
| RecordType DeveloperName | Health_Care_Provider | account.csv |
|
|
36
|
-
| IsActive | True | account.csv
|
|
36
|
+
| IsActive | True | account.csv |
|
|
37
37
|
|
|
38
38
|
## HealthcareProvider
|
|
39
39
|
|
|
40
|
-
| Field |
|
|
40
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
41
41
|
|-------|-------|--------|
|
|
42
42
|
| Name | Aaron Morita HP | healthcareprovider.csv |
|
|
43
43
|
| IsActive | True | healthcareprovider.csv |
|
|
@@ -46,11 +46,11 @@ This is the CSV-driven **person** account (an individual provider). The HCO (org
|
|
|
46
46
|
| Status | Active | healthcareprovider.csv |
|
|
47
47
|
| AccountId | (from Account) | FK |
|
|
48
48
|
|
|
49
|
-
>
|
|
49
|
+
> Use only the row's live CSV values.
|
|
50
50
|
|
|
51
51
|
## ContactPointAddress
|
|
52
52
|
|
|
53
|
-
| Field |
|
|
53
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
54
54
|
|-------|-------|--------|
|
|
55
55
|
| Name | 415 Mission St | contactpointaddress.csv |
|
|
56
56
|
| AddressType | Billing | contactpointaddress.csv |
|
|
@@ -165,7 +165,7 @@ sf data create record --sobject ProviderAcctTerritoryInfo --target-org <admin> \
|
|
|
165
165
|
|
|
166
166
|
## ObjectTerritory2Association
|
|
167
167
|
|
|
168
|
-
| Field |
|
|
168
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
169
169
|
|-------|-------|--------|
|
|
170
170
|
| ObjectId | (from Account) | FK |
|
|
171
171
|
| Territory2Id | (Stage-3 level-3 territory) | FK |
|
|
@@ -173,7 +173,7 @@ sf data create record --sobject ProviderAcctTerritoryInfo --target-org <admin> \
|
|
|
173
173
|
|
|
174
174
|
## ProviderAcctTerritoryInfo
|
|
175
175
|
|
|
176
|
-
| Field |
|
|
176
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
177
177
|
|-------|-------|--------|
|
|
178
178
|
| AccountId | (from Account) | FK |
|
|
179
179
|
| Territory2Id | (Stage-3 level-3 territory) | FK |
|
|
@@ -183,19 +183,20 @@ sf data create record --sobject ProviderAcctTerritoryInfo --target-org <admin> \
|
|
|
183
183
|
| IsTargetedAccount | True | provideracctterritoryinfo.csv |
|
|
184
184
|
| SourceType | Manual | provideracctterritoryinfo.csv |
|
|
185
185
|
|
|
186
|
-
## Product2
|
|
186
|
+
## Product2
|
|
187
187
|
|
|
188
|
-
| Field |
|
|
188
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
189
189
|
|-------|-------|--------|
|
|
190
190
|
| Name | Immunexis 5mg | product2.csv |
|
|
191
191
|
| ProductCode | IM001-5 | product2.csv |
|
|
192
192
|
| IsActive | True | product2.csv |
|
|
193
|
+
| RecordTypeId | (resolve in the target org: `RecordType` `DeveloperName='LSC_Sample'`) | product2.csv holds a **foreign** Id — ignore it; use the resolved target-org Id |
|
|
193
194
|
|
|
194
|
-
>
|
|
195
|
+
> `RecordTypeId`: the value in `product2.csv` comes from the export org and is not valid here. Query the target org for the `Product2` RecordType with `DeveloperName='LSC_Sample'` and use that Id.
|
|
195
196
|
|
|
196
197
|
## LifeSciMarketableProduct
|
|
197
198
|
|
|
198
|
-
| Field |
|
|
199
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
199
200
|
|-------|-------|--------|
|
|
200
201
|
| Name | Immunexis 5mg | lifescimarketableproduct.csv |
|
|
201
202
|
| ProductId | (from Product2) | FK |
|
|
@@ -208,11 +209,13 @@ sf data create record --sobject ProviderAcctTerritoryInfo --target-org <admin> \
|
|
|
208
209
|
| StartDate | 2026-07-01 | lifescimarketableproduct.csv |
|
|
209
210
|
| Type | Product | lifescimarketableproduct.csv |
|
|
210
211
|
|
|
211
|
-
>
|
|
212
|
+
> Create **one row per data row** in `lifescimarketableproduct.csv`, each pointing at the matching `Product2` (resolve the parent via the product natural-key→Id map keyed on `ProductCode`/`Name` — do not thread a single product Id). Capture each resulting `LifeSciMarketableProduct` Id.
|
|
213
|
+
>
|
|
214
|
+
> Part B (plan templates) references **one** LifeSciMarketableProduct as `GoalDefinitionProduct.ProductId` (the `Immunexis 5mg` product). If the CSV now yields multiple products, that Part B link still targets the single named product — Part B is intentionally not CSV-driven, so this coupling is by design; confirm the intended product Id is captured for Part B.
|
|
212
215
|
|
|
213
216
|
## ProductTerritoryAvailability
|
|
214
217
|
|
|
215
|
-
| Field |
|
|
218
|
+
| Field | Example / decode-only (read the live CSV) | Source |
|
|
216
219
|
|-------|-------|--------|
|
|
217
220
|
| ProductId | (from LifeSciMarketableProduct) | FK |
|
|
218
221
|
| TerritoryId | (Stage-3 level-3 territory) | FK |
|