@salesforce/afv-skills 1.58.0 → 1.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-architecture-analyze/SKILL.md +66 -17
  3. package/skills/agentforce-architecture-analyze/assets/cli/show_access_token.yaml +4 -7
  4. package/skills/agentforce-architecture-analyze/references/contract.json +1 -1
  5. package/skills/agentforce-architecture-analyze/scripts/emit_env.py +2 -2
  6. package/skills/agentforce-architecture-analyze/scripts/main.py +40 -44
  7. package/skills/agentforce-architecture-analyze/scripts/rest_client.py +11 -3
  8. package/skills/agentforce-architecture-analyze/scripts/sf_cli.py +77 -10
  9. package/skills/agentforce-architecture-analyze/scripts/tests/test_end_to_end_fixture.py +1 -0
  10. package/skills/agentforce-architecture-analyze/scripts/tests/test_flow_children_inflation.py +1 -0
  11. package/skills/agentforce-architecture-analyze/scripts/tests/test_main_pipeline.py +53 -2
  12. package/skills/agentforce-architecture-analyze/scripts/tests/test_resolve_creds.py +184 -36
  13. package/skills/agentforce-architecture-analyze/scripts/tests/test_rest_client.py +17 -0
  14. package/skills/agentforce-architecture-analyze/scripts/tests/test_sf_cli.py +165 -11
  15. package/skills/agentforce-architecture-analyze/scripts/tests/test_skill_md_pipeline_block.py +319 -0
  16. package/skills/agentforce-bot-upgrade/SKILL.md +3 -1
  17. package/skills/agentforce-d360-analyze/SKILL.md +28 -10
  18. package/skills/agentforce-d360-analyze/scripts/dc.py +200 -50
  19. package/skills/agentforce-d360-analyze/scripts/discover_sessions.py +10 -6
  20. package/skills/agentforce-d360-analyze/scripts/fetch_dc.py +22 -6
  21. package/skills/agentforce-d360-analyze/scripts/resolve_session.py +21 -13
  22. package/skills/agentforce-d360-analyze/scripts/tests/test_dc_and_resolve_session.py +298 -76
  23. package/skills/agentforce-d360-analyze/scripts/tests/test_default_target_org.py +432 -0
  24. package/skills/agentforce-d360-analyze/scripts/tests/test_discover_sessions.py +1 -1
  25. package/skills/agentforce-d360-analyze/scripts/tests/test_resolve_session_main.py +9 -3
  26. package/skills/agentforce-d360-analyze/scripts/tests/test_skill_md_prefix_block.py +176 -0
  27. package/skills/agentforce-generate/SKILL.md +21 -1
  28. package/skills/agentforce-generate/references/known-issues.md +51 -1
  29. package/skills/agentforce-generate/references/legacy-nga-regression-eval.md +547 -0
  30. package/skills/agentforce-generate/references/upgrade-legacy-agent-to-agentscript.md +577 -0
  31. package/skills/agentforce-generate/scripts/upgrade-legacy-nga-analyze.py +404 -0
  32. package/skills/agentforce-generate/scripts/upgrade-legacy-nga-run-trials.sh +58 -0
  33. package/skills/agentforce-persona-generate/SKILL.md +505 -0
  34. package/skills/agentforce-persona-generate/assets/checklist-template.md +100 -0
  35. package/skills/agentforce-persona-generate/assets/persona-encoding-template.md +252 -0
  36. package/skills/agentforce-persona-generate/assets/persona-template.md +229 -0
  37. package/skills/agentforce-persona-generate/assets/sample-dialog-template.md +50 -0
  38. package/skills/agentforce-persona-generate/assets/workshop-outline-template.md +97 -0
  39. package/skills/agentforce-persona-generate/examples/concierge-persona.md +189 -0
  40. package/skills/agentforce-persona-generate/examples/concierge-sample-dialog.md +70 -0
  41. package/skills/agentforce-persona-generate/examples/drover-persona.md +194 -0
  42. package/skills/agentforce-persona-generate/examples/drover-sample-dialog.md +62 -0
  43. package/skills/agentforce-persona-generate/examples/steady-hand-persona.md +188 -0
  44. package/skills/agentforce-persona-generate/examples/steady-hand-sample-dialog.md +68 -0
  45. package/skills/agentforce-persona-generate/examples/yt-persona.md +195 -0
  46. package/skills/agentforce-persona-generate/examples/yt-sample-dialog.md +66 -0
  47. package/skills/agentforce-persona-generate/references/attributions.md +36 -0
  48. package/skills/agentforce-persona-generate/references/interaction-design-notes.md +30 -0
  49. package/skills/agentforce-persona-generate/references/persona-encoding-guide.md +566 -0
  50. package/skills/agentforce-persona-generate/references/persona-framework.md +796 -0
  51. package/skills/agentforce-persona-generate/references/refinement-mappings.md +31 -0
  52. package/skills/agentforce-persona-generate/references/scoring-rubric.md +58 -0
  53. package/skills/agentforce-persona-generate/references/voice-catalog.json +2327 -0
  54. package/skills/agentforce-persona-generate/references/workshop-question-policy.md +90 -0
  55. package/skills/agentforce-persona-generate/references/workshop-scenario-seeds.md +119 -0
  56. package/skills/agentforce-persona-generate/scripts/parse_agent_yaml.py +223 -0
  57. package/skills/consumer-goods-accruals-datakit-deploy/SKILL.md +17 -27
  58. package/skills/consumer-goods-accruals-datakit-deploy/scripts/setup.js +7 -17
  59. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/00-check-prerequisites.js +47 -63
  60. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/01-download-static-resource.js +10 -13
  61. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/02-replace-org-id.js +46 -46
  62. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/03-deploy-metadata.js +4 -21
  63. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/06-create-dataspace.js +58 -82
  64. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/07-deploy-accruals-reports.js +16 -315
  65. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/08-deploy-ui.js +9 -24
  66. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/09-completion.js +44 -44
  67. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/utils.js +11 -63
  68. package/skills/consumer-goods-rtr-datacloud-export-configure/SKILL.md +2 -1
  69. package/skills/consumer-goods-tpe-dashboard-configure/SKILL.md +2 -1
  70. package/skills/consumer-goods-tpe-dashboard-custom-kpi-configure/SKILL.md +2 -1
  71. package/skills/consumer-goods-tpe-datakit-deploy/SKILL.md +2 -1
  72. package/skills/data360-schema-get/SKILL.md +3 -3
  73. package/skills/design-systems-slds-validate/references/report-format.md +1 -1
  74. package/skills/dx-app-analytics-query/SKILL.md +8 -8
  75. package/skills/dx-org-manage/SKILL.md +1 -0
  76. package/skills/dx-org-shape-manage/SKILL.md +1 -0
  77. package/skills/dx-org-snapshot-manage/SKILL.md +172 -0
  78. package/skills/dx-org-snapshot-manage/examples/create_error_output.json +16 -0
  79. package/skills/dx-org-snapshot-manage/examples/create_success_output.json +19 -0
  80. package/skills/dx-org-snapshot-manage/examples/delete_output.json +9 -0
  81. package/skills/dx-org-snapshot-manage/examples/get_output.json +19 -0
  82. package/skills/dx-org-snapshot-manage/examples/list_output.json +36 -0
  83. package/skills/dx-org-snapshot-manage/references/cli_flags.md +179 -0
  84. package/skills/dx-org-snapshot-manage/references/snapshot_usage.md +55 -0
  85. package/skills/dx-org-trial-expiration-check/SKILL.md +1 -1
  86. package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +2 -2
  87. package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +7 -5
  88. package/skills/education-cloud-student-recruitment-agent-configure/references/prerequisites.md +11 -11
  89. package/skills/experience-content-media-image-generate/SKILL.md +83 -0
  90. package/skills/experience-content-media-image-generate/scripts/download-image.sh +84 -0
  91. package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -12
  92. package/skills/experience-ui-bundle-app-coordinate/references/phase-completion-validation.md +3 -3
  93. package/skills/experience-ui-bundle-app-coordinate/references/phase-execution-pattern.md +9 -7
  94. package/skills/experience-ui-bundle-app-coordinate/scripts/check-dangling-refs.mjs +132 -0
  95. package/skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.mjs +62 -0
  96. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-1-complete.mjs +71 -0
  97. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-4-complete.mjs +95 -0
  98. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-6-ready.mjs +78 -0
  99. package/skills/experience-ui-bundle-app-coordinate/scripts/check-prerequisites.mjs +21 -0
  100. package/skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.mjs +28 -0
  101. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +3 -1
  102. package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.mjs +40 -0
  103. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +7 -5
  104. package/skills/experience-ui-bundle-frontend-generate/scripts/check-preconditions.mjs +70 -0
  105. package/skills/experience-ui-bundle-frontend-generate/scripts/resolve-ui-bundle.mjs +76 -0
  106. package/skills/experience-ui-bundle-frontend-generate/scripts/verify-rules.mjs +115 -0
  107. package/skills/experience-ui-bundle-metadata-generate/SKILL.md +7 -3
  108. package/skills/experience-ui-bundle-metadata-generate/references/angular-metadata-generate.md +1 -1
  109. package/skills/experience-ui-bundle-metadata-generate/references/react-metadata-generate.md +1 -1
  110. package/skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.mjs +43 -0
  111. package/skills/experience-ui-bundle-metadata-generate/scripts/detect-framework.mjs +131 -0
  112. package/skills/experience-ui-bundle-metadata-generate/scripts/verify-bundle-location.mjs +152 -0
  113. package/skills/experience-ui-bundle-mfa-configure/references/branding.md +10 -6
  114. package/skills/external-diagram-mermaid-generate/SKILL.md +12 -12
  115. package/skills/field-service-data-capture-migrate/references/component-mapping.md +1 -1
  116. package/skills/field-service-data-capture-migrate/references/fsm-dc-capability-catalog.md +1 -2
  117. package/skills/field-service-data-capture-migrate/references/known-deploy-errors.md +1 -0
  118. package/skills/field-service-data-capture-migrate/references/transformer-rules.md +1 -1
  119. package/skills/field-service-data-capture-migrate/scripts/transform_flow.py +12 -1
  120. package/skills/field-service-data-capture-migrate/scripts/vendor/build_flow.py +4 -1
  121. package/skills/field-service-setup-orchestrator-get/SKILL.md +0 -1
  122. package/skills/insurance-brokerage-agency-billing-configure/SKILL.md +233 -0
  123. package/skills/insurance-brokerage-agency-billing-configure/references/accounting-setup.md +117 -0
  124. package/skills/insurance-brokerage-agency-billing-configure/references/billing-rules-config.md +237 -0
  125. package/skills/insurance-brokerage-agency-billing-configure/references/billing-settings.md +271 -0
  126. package/skills/insurance-brokerage-agency-billing-configure/references/demo-policy-config.md +138 -0
  127. package/skills/insurance-brokerage-agency-billing-configure/references/org-defaults.md +64 -0
  128. package/skills/insurance-brokerage-agency-billing-configure/references/permissions-config.md +226 -0
  129. package/skills/insurance-brokerage-agency-billing-configure/references/prerequisites.md +142 -0
  130. package/skills/life-sciences-fieldsalesrep-coordinate/SKILL.md +3 -2
  131. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-execution-state-and-recovery.md +3 -3
  132. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-overview.md +68 -45
  133. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-visit-creation-data.md +17 -18
  134. package/skills/life-sciences-kam-coordinate/references/stage-5-data-and-plan-templates-overview.md +16 -3
  135. package/skills/life-sciences-kam-coordinate/references/stage-5-data-creation-data.md +16 -13
  136. package/skills/marketing-message-test/SKILL.md +194 -0
  137. package/skills/marketing-message-test/references/api-contract.md +333 -0
  138. package/skills/omnistudio-callable-apex-generate/SKILL.md +3 -3
  139. package/skills/omnistudio-datamapper-generate/SKILL.md +6 -6
  140. package/skills/omnistudio-datapacks-deploy/SKILL.md +11 -11
  141. package/skills/omnistudio-dependencies-analyze/SKILL.md +5 -5
  142. package/skills/omnistudio-epc-catalog-generate/SKILL.md +6 -6
  143. package/skills/omnistudio-flexcard-generate/SKILL.md +6 -6
  144. package/skills/omnistudio-integration-procedure-generate/SKILL.md +6 -6
  145. package/skills/omnistudio-omniscript-generate/SKILL.md +6 -5
  146. package/skills/platform-apex-logs-debug/SKILL.md +1 -0
  147. package/skills/platform-metadata-deploy/SKILL.md +1 -0
  148. package/skills/platform-models-api-configure/SKILL.md +5 -5
  149. package/skills/platform-soql-query/SKILL.md +1 -0
  150. package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +17 -6
  151. package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +107 -192
  152. package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/attach-milestone-action.json +6 -6
  153. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +49 -20
  154. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/output-templates.md +4 -4
  155. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +224 -290
  156. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/workflow.md +295 -0
  157. package/skills/service-itsm-incident-priority-configure/SKILL.md +1 -1
  158. package/skills/service-itsm-slack-itservice-configure/SKILL.md +2 -1
  159. package/skills/service-itsm-slack-itservice-configure/references/manage-slack-connection.md +2 -2
  160. package/skills/service-omni-channel-setup-coordinate/SKILL.md +20 -13
  161. package/skills/service-omni-channel-setup-coordinate/scripts/integration-driver.sh +5 -55
  162. package/skills/service-omni-channel-setup-coordinate/scripts/tests/test_omni_contracts.py +0 -38
  163. package/skills/service-omni-command-center-analyze/SKILL.md +2 -3
  164. package/skills/service-omni-command-center-analyze/scripts/analyze.sh +3 -3
  165. package/skills/tableau-next-asset-create/README.md +65 -0
  166. package/skills/tableau-next-asset-create/SKILL.md +409 -0
  167. package/skills/tableau-next-asset-create/references/admin-users.md +149 -0
  168. package/skills/tableau-next-asset-create/references/ai-readiness.md +355 -0
  169. package/skills/tableau-next-asset-create/references/alerts.md +111 -0
  170. package/skills/tableau-next-asset-create/references/build-workflow.md +819 -0
  171. package/skills/tableau-next-asset-create/references/dashboard-authoring.md +302 -0
  172. package/skills/tableau-next-asset-create/references/dashboard-design-principles.md +352 -0
  173. package/skills/tableau-next-asset-create/references/data-transform-gotchas.md +210 -0
  174. package/skills/tableau-next-asset-create/references/data-understanding.md +387 -0
  175. package/skills/tableau-next-asset-create/references/deep-reference-index.md +74 -0
  176. package/skills/tableau-next-asset-create/references/destructive-operations.md +62 -0
  177. package/skills/tableau-next-asset-create/references/edit-dashboard.md +273 -0
  178. package/skills/tableau-next-asset-create/references/edit-visualization.md +529 -0
  179. package/skills/tableau-next-asset-create/references/empty-source-handling.md +104 -0
  180. package/skills/tableau-next-asset-create/references/ingest-and-metric-gotchas.md +638 -0
  181. package/skills/tableau-next-asset-create/references/insight-bundle.md +69 -0
  182. package/skills/tableau-next-asset-create/references/large-flat-file-handling.md +331 -0
  183. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/_envelope.json +54 -0
  184. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/_shared-widget-fields.json +122 -0
  185. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/add_page.json +29 -0
  186. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/delete_page.json +27 -0
  187. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/discard_dashboard.json +11 -0
  188. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/move_widget.json +30 -0
  189. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/move_widget_to_page.json +30 -0
  190. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/place_widget_on_page.json +30 -0
  191. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/remove_widget_from_dashboard.json +16 -0
  192. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/remove_widget_from_page.json +26 -0
  193. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/rename_page.json +28 -0
  194. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/save_dashboard.json +18 -0
  195. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/undo.json +11 -0
  196. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_button_widget.json +69 -0
  197. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_container_widget.json +88 -0
  198. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_filter_widget.json +146 -0
  199. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_metric_widget.json +78 -0
  200. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_navigation_widget.json +80 -0
  201. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_parameter_widget.json +160 -0
  202. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_text_widget.json +103 -0
  203. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_visualization_widget.json +68 -0
  204. package/skills/tableau-next-asset-create/references/sdm-tool-reference.md +721 -0
  205. package/skills/tableau-next-asset-create/references/semantic-query-and-enrichment.md +355 -0
  206. package/skills/tableau-next-asset-create/references/shared-gates.md +322 -0
  207. package/skills/tableau-next-asset-create/references/sharing-and-promotion.md +306 -0
  208. package/skills/tableau-next-asset-create/references/tasks/ai-readiness-audit.md +51 -0
  209. package/skills/tableau-next-asset-create/references/tasks/analyze-data.md +48 -0
  210. package/skills/tableau-next-asset-create/references/tasks/build-dashboard.md +66 -0
  211. package/skills/tableau-next-asset-create/references/tasks/build-end-to-end.md +73 -0
  212. package/skills/tableau-next-asset-create/references/tasks/create-data-transform.md +51 -0
  213. package/skills/tableau-next-asset-create/references/tasks/create-viz.md +58 -0
  214. package/skills/tableau-next-asset-create/references/tasks/edit-dashboard.md +80 -0
  215. package/skills/tableau-next-asset-create/references/tasks/edit-sdm.md +106 -0
  216. package/skills/tableau-next-asset-create/references/tasks/edit-viz.md +40 -0
  217. package/skills/tableau-next-asset-create/references/tasks/enrich-model.md +68 -0
  218. package/skills/tableau-next-asset-create/references/tasks/ingest-flat-file.md +68 -0
  219. package/skills/tableau-next-asset-create/references/tasks/manage-alert.md +35 -0
  220. package/skills/tableau-next-asset-create/references/tasks/profile-dataset.md +47 -0
  221. package/skills/tableau-next-asset-create/references/tasks/promote-or-reuse.md +46 -0
  222. package/skills/tableau-next-asset-create/references/tasks/provision-user.md +39 -0
  223. package/skills/tableau-next-asset-create/references/tasks/query-model.md +92 -0
  224. package/skills/tableau-next-asset-create/references/tasks/review-verified-questions.md +42 -0
  225. package/skills/tableau-next-asset-create/references/tasks/share-asset.md +37 -0
  226. package/skills/tableau-next-asset-create/references/verified-questions.md +125 -0
  227. package/skills/tableau-next-asset-create/references/viz-authoring.md +992 -0
  228. package/skills/experience-ui-bundle-app-coordinate/scripts/check-dangling-refs.sh +0 -42
  229. package/skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.sh +0 -26
  230. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-1-complete.sh +0 -35
  231. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-4-complete.sh +0 -47
  232. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-6-ready.sh +0 -33
  233. package/skills/experience-ui-bundle-app-coordinate/scripts/check-prerequisites.sh +0 -20
  234. package/skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.sh +0 -15
  235. package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +0 -30
  236. package/skills/experience-ui-bundle-frontend-generate/scripts/check-preconditions.sh +0 -37
  237. package/skills/experience-ui-bundle-frontend-generate/scripts/resolve-ui-bundle.sh +0 -66
  238. package/skills/experience-ui-bundle-frontend-generate/scripts/verify-rules.sh +0 -58
  239. package/skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.sh +0 -30
  240. package/skills/experience-ui-bundle-metadata-generate/scripts/detect-framework.sh +0 -73
  241. package/skills/experience-ui-bundle-metadata-generate/scripts/verify-bundle-location.sh +0 -118
  242. package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/predefined-incident-policy.json +0 -102
@@ -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 (RecordType = Health_Care_Provider)**
82
+ **Step 2: Create Account (one per row in `account.csv`)**
75
83
 
76
- First, query the RecordType ID:
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='Health_Care_Provider'" --target-org lsc-rep --json
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 the Account:
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 "FirstName='Aaron' LastName='Morita' Salutation='Dr.' RecordTypeId='<recordTypeId>' IsActive=true" --target-org lsc-rep --json
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
- > Reference: `account.csv` — Name=Aaron Morita, Salutation=Dr., RecordType=Health_Care_Provider.
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
- Then create:
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 "AccountId='<accountId>' IsActive=true IsPrimaryProvider=true Name='Aaron Morita HP' ProviderType='Medical Doctor' Status='Active' RecordTypeId='<hcpRecordTypeId>'" --target-org lsc-rep --json
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
- > Reference: `healthcareprovider.csv` — ProviderType=Medical Doctor, Status=Active. Do NOT set `NationalProviderIdentifier` or `IsSpeaker` — they (and `IsActive`) are FLS-gated on the LSC Custom Profile, so as the rep the create fails with `INVALID_FIELD`. Omit NPI/IsSpeaker (an admin can set them later).
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 "ParentId='<accountId>' AddressType='Billing' Name='415 Mission St' Street='415 Mission St' City='San Francisco' State='California' StateCode='CA' PostalCode='94105' Country='United States' CountryCode='US' Latitude=37.789853 Longitude=-122.396806 IsActive=true IsPrimary=true UsageType='Work'" --target-org lsc-rep --json
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
- > Reference: `contactpointaddress.csv` — 415 Mission St, San Francisco, CA 94105
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
- 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`:
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>' AssociationCause='Territory2Manual'" --target-org <admin> --json
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
- > Reference: `objectterritory2association.csv` — AssociationCause=Territory2Manual. 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.
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>' IsActive=true IsAvailableOffline=true IsTargetedAccount=true SourceType='Manual'" --target-org lsc-rep --json
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
- > Reference: `provideracctterritoryinfo.csv` — IsTargetedAccount=true, SourceType=Manual
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: Create Product2 (no RecordType) — as ADMIN**
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 "Name='Immunexis 5mg' ProductCode='IM001-5' IsActive=true" --target-org <admin> --json
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
- > Reference: `product2.csv` — Do NOT set a RecordType.
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 "Name='Immunexis 5mg' ProductId='<product2Id>' IsActive=true IsAvlForSamplingAllocation=true Manufacturer='Makana Health' DistributionMethod='Drop' SignatureRequirementLevel='Mandatory' SortOrder=100 StartDate=2026-07-01 Type='Product'" --target-org <admin> --json
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
- > Reference: `lifescimarketableproduct.csv` — Manufacturer=Makana Health, DistributionMethod=Drop
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 "ProductId='<lifeSciMarketableProductId>' TerritoryId='<territory2Id>' AlignmentType='Territory Inclusion' Purpose='Visit' Status='Draft' UsageType='LifeSciences'" --target-org <admin> --json
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
- > Reference: `productterritoryavailability.csv` — AlignmentType=Territory Inclusion, Purpose=Visit. 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.
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>' PlannedVisitStartTime='<NOW_ISO8601>' Status='Planned' TerritoryId='<territory2Id>'" --target-org lsc-rep --json
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
- Then create:
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>' IsConfirmed=false" --target-org lsc-rep --json
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>' Priority=4 AdditionalInformation='Discussed Oncology products and treatments' IsGeneratedFromPresentation=false" --target-org lsc-rep --json
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
- > Reference: `providervisitproddetailing.csv` — Priority=4, AdditionalInformation about Oncology products
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 "ProviderVisitProductDtlId='<providerVisitProdDetailingId>' Note='Discussed Oncology treatments and patient care approaches'" --target-org lsc-rep --json
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
- > Reference: `providervisitproddiscussion.csv` — Note about Oncology treatments
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 must NOT have a RecordType.
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 FLS on HealthcareProvider (NPI/IsSpeaker) 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`.
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 | Value | Source |
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 (standard `IsActive` boolean — NOT `IsActive__c`) |
38
+ | IsActive | True | account.csv |
39
39
 
40
- > Created as the **rep** (`--target-org lsc-rep`). `IsActive` is the standard field; if the rep lacks FLS to it, omit and set as admin.
40
+ > Created as the **rep** (`--target-org lsc-rep`).
41
41
 
42
42
  ## HealthcareProvider
43
43
 
44
- | Field | Value | Source |
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 | Value | Source |
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 | Value | Source |
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 | Value | Source |
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 (NO RecordType)
95
+ ## Product2
98
96
 
99
- | Field | Value | Source |
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
- > Do NOT set RecordTypeId — this is an explicit requirement.
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 | Value | Source |
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 | Value | Source |
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 | Value | Source |
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 | Value | Source |
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 | Value | Source |
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 | Value | Source |
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 |
@@ -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
- 1. **Read the live CSV for each object** — never hardcode values from the reference table. Full field-by-field mapping: `references/stage-5-data-creation-data.md`.
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` | Do NOT set `RecordTypeId` on Product2 — it takes no record type |
78
- | A create fails on an FLS-gated field | As admin this is rare; omit the offending non-required field and continue (see the per-object notes in the data reference) |
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 | Value | Source |
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 (standard `IsActive` boolean — NOT `IsActive__c`) |
36
+ | IsActive | True | account.csv |
37
37
 
38
38
  ## HealthcareProvider
39
39
 
40
- | Field | Value | Source |
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
- > As admin you have FLS to all fields, so `NationalProviderIdentifier` and `IsSpeaker` may be set if the CSV lists them. If a create fails on a field, omit it and continue — those two are not required by any KAM downstream record.
49
+ > Use only the row's live CSV values.
50
50
 
51
51
  ## ContactPointAddress
52
52
 
53
- | Field | Value | Source |
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 | Value | Source |
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 | Value | Source |
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 (NO RecordType)
186
+ ## Product2
187
187
 
188
- | Field | Value | Source |
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
- > Do NOT set RecordTypeId — explicit requirement.
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 | Value | Source |
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
- > Capture the resulting `LifeSciMarketableProduct` Id — Part B (plan templates) of this stage references it as the `GoalDefinitionProduct.ProductId`.
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 | Value | Source |
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 |