@salesforce/afv-skills 1.40.0 → 1.41.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/automation-flow-generate/SKILL.md +32 -43
- package/skills/experience-portal-create/SKILL.md +497 -0
- package/skills/experience-portal-create/assets/report-template.md +30 -0
- package/skills/experience-portal-create/references/mcp-invocation.md +288 -0
- package/skills/experience-portal-create/references/post-creation-activate-publish.md +165 -0
- package/skills/experience-portal-create/references/templates.md +253 -0
- package/skills/experience-ui-bundle-features-generate/SKILL.md +5 -1
- package/skills/experience-ui-bundle-frontend-generate/SKILL.md +2 -0
- package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -0
- package/skills/platform-datamask-run/SKILL.md +345 -0
- package/skills/platform-datamask-run/references/api-surface.md +130 -0
- package/skills/platform-datamask-run/references/policy-authoring.md +185 -0
- package/skills/platform-datamask-run/references/run-and-abort.md +116 -0
- package/skills/platform-datamask-run/scripts/poll-job.sh +115 -0
- package/skills/platform-dataspace-access-configure/SKILL.md +51 -3
- package/skills/platform-dataspace-access-configure/scripts/inspect-dataspace-scopes.sh +56 -0
- package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +1 -0
- package/skills/platform-sandbox-configure/SKILL.md +17 -2
- package/skills/platform-trial-org-create/SKILL.md +175 -0
- package/skills/platform-trial-org-create/examples/create_request.json +9 -0
- package/skills/platform-trial-org-create/examples/error_response.json +41 -0
- package/skills/platform-trial-org-create/examples/success_response.json +27 -0
- package/skills/platform-trial-org-create/references/error_codes.md +42 -0
- package/skills/platform-trial-org-create/references/signup_request_fields.md +69 -0
- package/skills/platform-trial-org-create/scripts/create_signup_request.sh +175 -0
- package/skills/platform-trial-org-create/scripts/get_signup_request.sh +155 -0
- package/skills/platform-widget-generate/SKILL.md +47 -6
- package/skills/platform-widget-generate/examples/conditional.json +3 -3
- package/skills/platform-widget-generate/examples/list-with-foreach.json +2 -2
- package/skills/platform-widget-generate/examples/single-object.json +2 -2
- package/skills/platform-widget-generate/references/widget-bundle-layout.md +1 -1
- package/skills/service-agentforce-channel-configure/SKILL.md +271 -0
- package/skills/service-agentforce-channel-configure/references/agent-wiring.md +97 -0
- package/skills/service-agentforce-channel-configure/references/channel-branch-email.md +145 -0
- package/skills/service-agentforce-channel-configure/references/channel-branch-voice.md +69 -0
- package/skills/service-agentforce-channel-configure/references/channel-types.md +61 -0
- package/skills/service-agentforce-channel-configure/references/live-traffic-gate.md +86 -0
- package/skills/service-agentforce-channel-configure/references/queue-resolution.md +135 -0
- package/skills/service-agentforce-channel-configure/references/routing-flow.md +384 -0
- package/skills/service-catalog-template-deploy/SKILL.md +310 -0
- package/skills/service-catalog-template-deploy/references/cli-invocation.md +258 -0
- package/skills/service-catalog-template-deploy/scripts/activate-verify.mjs +164 -0
- package/skills/service-catalog-template-deploy/scripts/build-deploy-payload.mjs +94 -0
- package/skills/service-catalog-template-deploy/scripts/resolve-template.mjs +331 -0
- package/skills/service-catalog-template-search/SKILL.md +212 -0
- package/skills/service-catalog-template-search/references/cli-invocation.md +128 -0
- package/skills/service-catalog-template-search/scripts/classify-catalog.mjs +205 -0
- package/skills/service-concierge-portal-generate/SKILL.md +126 -0
- package/skills/service-concierge-portal-generate/references/portal-deploy-runbook.md +1428 -0
- package/skills/service-digital-engagement-channel-configure/SKILL.md +46 -6
- package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +2 -1
- package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +4 -1
- package/skills/service-helpagent-coordinate/README.md +8 -2
- package/skills/service-helpagent-coordinate/SKILL.md +126 -130
- package/skills/service-helpagent-coordinate/assets/help-agent-spec.md +70 -53
- package/skills/service-helpagent-coordinate/references/agent-script.md +571 -457
- package/skills/service-helpagent-coordinate/references/channel-voice.md +38 -9
- package/skills/service-helpagent-coordinate/references/channel-web-chat.md +173 -49
- package/skills/service-helpagent-coordinate/references/output-report-format.md +126 -0
- package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +153 -0
- package/skills/service-itsm-agentic-setup-agentforce-coordinate/examples/output-templates.md +79 -0
- package/skills/service-itsm-agentic-setup-agentforce-coordinate/scripts/verify-child-verdict.mjs +35 -0
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +271 -0
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/references/cli-invocation.md +265 -0
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/scripts/classify-enable-plan.mjs +220 -0
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/scripts/classify-final-report.mjs +102 -0
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/scripts/record-enable-result.mjs +73 -0
- package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +206 -0
- package/skills/service-itsm-agentic-setup-agentforce-studio-validate/references/cli-invocation.md +194 -0
- package/skills/service-itsm-agentic-setup-agentforce-studio-validate/scripts/classify-readiness.mjs +223 -0
- package/skills/service-itsm-agentic-setup-cmdb-configure/SKILL.md +45 -7
- package/skills/service-itsm-agentic-setup-cmdb-configure/references/mcp-invocation.md +45 -5
- package/skills/service-itsm-agentic-setup-configure/SKILL.md +116 -0
- package/skills/service-itsm-agentic-setup-configure/examples/output-templates.md +64 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +158 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/references/cli-invocation.md +361 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/references/error-taxonomy.md +44 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/references/reactivation.md +66 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/references/report-format.md +66 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/references/specialized-templates.md +148 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/references/workflow-detail.md +169 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/build-create-body.mjs +116 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/classify-agent-existence.mjs +185 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/classify-preflight.mjs +168 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/create-scratch-dir.mjs +58 -0
- package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/render-report.mjs +197 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +186 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/action-availability.md +51 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/cli-invocation.md +345 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/error-taxonomy.md +44 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/reactivation.md +63 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/report-format.md +44 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/workflow-detail.md +149 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/build-create-body.mjs +110 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-action-availability.mjs +201 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-activate-result.mjs +135 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-agent-existence.mjs +194 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-preflight.mjs +158 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/create-scratch-dir.mjs +58 -0
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/render-report.mjs +191 -0
- package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +133 -0
- package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +71 -0
- package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +308 -0
- package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/attach-milestone.json +23 -0
- package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +193 -0
- package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/output-templates.md +57 -0
- package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +394 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +266 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/cli-invocation.md +106 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/helper-contracts.md +142 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/permset-topology.md +82 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/classify-action-surface.mjs +137 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/classify-assignment-state.mjs +99 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/classify-permset-availability.mjs +120 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/resolve-target-user.mjs +86 -0
- package/skills/service-itsm-agentic-setup-uel-user-create/SKILL.md +284 -0
- package/skills/service-itsm-agentic-setup-uel-user-create/references/mcp-invocation.md +302 -0
- package/skills/service-itsm-channels-coordinate/SKILL.md +472 -0
- package/skills/service-itsm-incident-mgmt-configure/SKILL.md +212 -0
- package/skills/service-itsm-incident-mgmt-configure/references/mcp-invocation.md +225 -0
- package/skills/service-itsm-incident-priority-configure/SKILL.md +53 -12
- package/skills/service-itsm-swarming-configure/SKILL.md +212 -0
- package/skills/service-itsm-teams-configure/SKILL.md +395 -0
- package/skills/service-itsm-teams-configure/references/azure-credential-population.md +213 -0
- package/skills/service-itsm-teams-configure/references/gotchas.md +23 -0
- package/skills/service-itsm-teams-coordinate/SKILL.md +175 -0
- package/skills/service-itsm-teams-coordinate/examples/output-templates.md +85 -0
- package/skills/service-itsm-teams-debug/SKILL.md +144 -0
- package/skills/service-itsm-teams-debug/references/configuration-checklists.md +277 -0
- package/skills/service-itsm-teams-debug/references/report-generation.md +95 -0
- package/skills/service-itsm-teams-employee-agent-configure/SKILL.md +139 -0
- package/skills/service-itsm-teams-employee-agent-configure/assets/Teams_AgentForce.EmbeddedServiceConfig-meta.xml +43 -0
- package/skills/service-itsm-teams-employee-agent-configure/references/teams-embedded-employee-agent.md +480 -0
- package/skills/service-itsm-teams-itdesk-configure/SKILL.md +232 -0
- package/skills/service-itsm-teams-itservice-configure/SKILL.md +391 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# inspect-dataspace-scopes.sh — extract dataspaceScopes from retrieved PermissionSet metadata
|
|
3
|
+
# Usage: scripts/inspect-dataspace-scopes.sh <retrieved-dir> [dataspace-api-name]
|
|
4
|
+
# Output: PermissionSet|dataspaceScope|dataAccessLevel|objectAccessLevel (one per line)
|
|
5
|
+
# "NO_PERMISSIONSETS_FOUND" if retrieval yielded no permission sets, or
|
|
6
|
+
# "NO_MATCHES" if no retrieved permission set matched
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
RETRIEVED_DIR="${1:-}"
|
|
10
|
+
DATASPACE_FILTER="${2:-}"
|
|
11
|
+
|
|
12
|
+
[[ -d "$RETRIEVED_DIR" ]] || {
|
|
13
|
+
echo "ERROR: retrieved-dir '$RETRIEVED_DIR' not found" >&2
|
|
14
|
+
exit 1
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
command -v python3 >/dev/null 2>&1 || {
|
|
18
|
+
echo "ERROR: python3 required" >&2
|
|
19
|
+
exit 1
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
python3 - "$RETRIEVED_DIR" "$DATASPACE_FILTER" <<'PYEOF'
|
|
23
|
+
import sys, os, glob, xml.etree.ElementTree as ET
|
|
24
|
+
|
|
25
|
+
retrieved_dir, dataspace_filter = sys.argv[1], sys.argv[2]
|
|
26
|
+
ns = {"md": "http://soap.sforce.com/2006/04/metadata"}
|
|
27
|
+
rows = []
|
|
28
|
+
paths = sorted(glob.glob(
|
|
29
|
+
os.path.join(retrieved_dir, "**", "*.permissionset-meta.xml"), recursive=True
|
|
30
|
+
))
|
|
31
|
+
|
|
32
|
+
if not paths:
|
|
33
|
+
print("NO_PERMISSIONSETS_FOUND")
|
|
34
|
+
sys.exit()
|
|
35
|
+
|
|
36
|
+
for path in paths:
|
|
37
|
+
permset_name = os.path.basename(path).replace(".permissionset-meta.xml", "")
|
|
38
|
+
try:
|
|
39
|
+
root = ET.parse(path).getroot()
|
|
40
|
+
except ET.ParseError:
|
|
41
|
+
continue
|
|
42
|
+
|
|
43
|
+
for scope in root.findall("md:dataspaceScopes", ns):
|
|
44
|
+
name = (scope.findtext("md:dataspaceScope", "", ns) or "").strip()
|
|
45
|
+
if dataspace_filter and name != dataspace_filter:
|
|
46
|
+
continue
|
|
47
|
+
|
|
48
|
+
rows.append((
|
|
49
|
+
permset_name,
|
|
50
|
+
name,
|
|
51
|
+
(scope.findtext("md:dataAccessLevel", "", ns) or "").strip(),
|
|
52
|
+
(scope.findtext("md:objectAccessLevel", "", ns) or "").strip()
|
|
53
|
+
))
|
|
54
|
+
|
|
55
|
+
print("NO_MATCHES" if not rows else "\n".join("|".join(r) for r in rows))
|
|
56
|
+
PYEOF
|
|
@@ -44,6 +44,7 @@ VALIDATIONS THAT WILL RUN AFTER GENERATION:
|
|
|
44
44
|
- widget schema.json parses and has the required root keys
|
|
45
45
|
- every leaf in properties has a lightning:type
|
|
46
46
|
- every {!$attrs.X} (and {!$attrs.<outer>.<inner>} for nested objects, {!$item.X} inside forEach) resolves
|
|
47
|
+
- every tile/button carries an actions.click entry using action/openLink or action/sendMessage
|
|
47
48
|
- <name>.uiwidget-meta.xml is well-formed XML, root is <UiWidgetBundle>, and declares <widgetType>JSON</widgetType>
|
|
48
49
|
Cross-skill checks (run by this orchestrator):
|
|
49
50
|
- lightning-type-unchanged: when an existing Lightning Type was used as input, its schema.json is byte-identical to the version captured before this run
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
name: platform-sandbox-configure
|
|
3
3
|
description: "MUST USE this skill for ANY sandbox request — including simply getting a sandbox's details, status, license type, or pending-activation state by name or ID. TRIGGER when the user: types \"sandbox -help\"/\"sandbox help\"; mentions a sandbox ID (07E prefix); asks to list or show sandboxes; asks for the details, status, license type, or config of a sandbox by name or ID; activates or discards a completed refresh; deletes a sandbox; verifies activation or deletion; creates or refreshes a sandbox. DO NOT TRIGGER when: the user wants to clone a sandbox."
|
|
4
4
|
metadata:
|
|
5
|
-
version: "1.
|
|
5
|
+
version: "1.1"
|
|
6
6
|
domains: ["Platform"]
|
|
7
7
|
minApiVersion: "66.0"
|
|
8
|
+
relatedSkills:
|
|
9
|
+
- "automation-sandbox-post-copy-config-generate"
|
|
10
|
+
- "automation-sandbox-post-copy-configure"
|
|
8
11
|
accessCheck:
|
|
9
12
|
- type: "userPerm"
|
|
10
13
|
value: "ManageSandboxes"
|
|
@@ -31,6 +34,8 @@ Use `platform-sandbox-configure` when the work involves:
|
|
|
31
34
|
|
|
32
35
|
Delegate elsewhere when the user is:
|
|
33
36
|
- Cloning a sandbox → Tooling API (`SandboxInfo` sObject)
|
|
37
|
+
- Generating a post-copy automation JSON config from an SOP → `automation-sandbox-post-copy-config-generate`
|
|
38
|
+
- Applying/running a post-copy automation JSON config against a sandbox → `automation-sandbox-post-copy-configure`
|
|
34
39
|
|
|
35
40
|
---
|
|
36
41
|
|
|
@@ -60,6 +65,10 @@ The agent MUST respond with this exact markdown (not in a code block — render
|
|
|
60
65
|
- a. Verify activation status — Check if activate completed
|
|
61
66
|
- b. Verify deletion status — Check if delete completed
|
|
62
67
|
|
|
68
|
+
**5. Post-Copy Automation**
|
|
69
|
+
- a. Create Post Copy Automation JSON Configs — Generate a config from an SOP
|
|
70
|
+
- b. Run Post Copy Automation — Apply a config JSON to a sandbox
|
|
71
|
+
|
|
63
72
|
Reply with a code (e.g. "3a") or describe what you need.
|
|
64
73
|
|
|
65
74
|
**After the user replies, ask for the required input:**
|
|
@@ -76,8 +85,14 @@ Reply with a code (e.g. "3a") or describe what you need.
|
|
|
76
85
|
| 3c | "Which sandbox? Provide a name or 07E ID." |
|
|
77
86
|
| 4a | "Which sandbox did you activate? Provide a name or 07E ID." |
|
|
78
87
|
| 4b | "Which sandbox did you delete? Provide a name or 07E ID." |
|
|
88
|
+
| 5a | "Delegating to the post-copy config generator — please share the SOP (file, text, or screenshot)." |
|
|
89
|
+
| 5b | "Delegating to the post-copy config runner — please share the config JSON file and the target sandbox." |
|
|
90
|
+
|
|
91
|
+
Execute the corresponding operation from the Operations section below. **Exception: 5a and 5b delegate to a different skill instead of an in-skill operation:**
|
|
92
|
+
- 5a → Invoke the `automation-sandbox-post-copy-config-generate` skill.
|
|
93
|
+
- 5b → Invoke the `automation-sandbox-post-copy-configure` skill.
|
|
79
94
|
|
|
80
|
-
|
|
95
|
+
This skill does not implement post-copy automation itself — it only routes to the two skills above. Do not attempt to generate or apply a post-copy config directly from this skill.
|
|
81
96
|
|
|
82
97
|
---
|
|
83
98
|
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: platform-trial-org-create
|
|
3
|
+
description: "Use this skill to create a Salesforce trial, developer, or Trialforce org against an already-authenticated host org, the same way a developer/Trialforce web signup form provisions one. INVOKE when the user asks to: create a trial org, sign up a new trial or developer org, provision a Trialforce org from a template, or check the status of a trial-org signup they started. Trigger phrases: 'create a trial org', 'sign up a trial org', 'spin up a dev org', 'Trialforce signup', 'provision trial from template', 'check my trial org signup status'. Do NOT use for scratch orgs (use dx-org-manage) or for checking trial expiration dates of existing orgs (use dx-org-trial-expiration-check)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
domains: ["Platform"]
|
|
7
|
+
minApiVersion: "60.0"
|
|
8
|
+
relatedSkills:
|
|
9
|
+
- "dx-org-manage"
|
|
10
|
+
- "dx-org-trial-expiration-check"
|
|
11
|
+
cliTools:
|
|
12
|
+
- tool: ["jq"]
|
|
13
|
+
semver: ">=1.6"
|
|
14
|
+
- tool: ["sf"]
|
|
15
|
+
semver: ">=2.0.0"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## What this skill does
|
|
19
|
+
|
|
20
|
+
Creates a Salesforce **trial org** by inserting a `SignupRequest` sObject with the `sf` CLI — the same request the Trialforce/developer **web signup form** issues under the hood. There is no bespoke signup endpoint: signup = inserting a `SignupRequest` (key prefix `0SR`) against an authenticated **host org** (a Trialforce Source Org / Env Hub / partner org that is entitled to create trial orgs).
|
|
21
|
+
|
|
22
|
+
The flow is **two CLI calls**: (1) create the `SignupRequest`, (2) read it back to pick up the assigned org id (creation is asynchronous — the org id appears shortly after the insert).
|
|
23
|
+
|
|
24
|
+
## Prerequisites — confirm before executing
|
|
25
|
+
|
|
26
|
+
1. **Authenticated host org — always confirm which one, explicitly.** You are signing up *from* an authenticated host org, not anonymously. The `sf` CLI operates against an org you have already logged into once (`sf org login web`, or `sf org login`).
|
|
27
|
+
|
|
28
|
+
**Always pass an explicit `--target-org` (`-o`) with the host org's alias or username on every command, and confirm the target with the user before creating** — even if a default org is configured. Creating a `SignupRequest` is a real provisioning action; do not let it run against whatever org happens to be the default.
|
|
29
|
+
|
|
30
|
+
- **Do not rely on the default-org fallback.** With no `-o`, the CLI resolves the target from `--target-org` → `SF_TARGET_ORG` env var → local then global `target-org` config, and **errors (`NoDefaultEnvError`) if none is set** — it never auto-picks among your connected orgs. That default may be an unrelated dev/scratch org, so an omitted `-o` is either wrong-org or a hard failure. Never omit it.
|
|
31
|
+
- **The user may have many authenticated orgs.** Run `sf org list` and, if the intended host org is ambiguous or not provided, ask the user which alias/username to use. Do not guess.
|
|
32
|
+
- **Verify the chosen org is `Connected`** in `sf org list` before creating (stale refresh tokens / expired certs show as error states, not `Connected`).
|
|
33
|
+
- Never invent credentials.
|
|
34
|
+
2. **Host org must be entitled to create trial orgs**, and the invoking user must have sufficient access on it. The skill does **not** run a separate permission check — the `sf data create record` call (Step 1) is the definitive gate, and the same API enforcement is what a check would rely on. If the org is not entitled, the `SignupRequest` entity is not exposed and the create fails with a non-zero `status` and `name`/`code` of `NOT_FOUND` ("The requested resource does not exist") or `INVALID_TYPE` ("sObject type 'SignupRequest' is not supported"). This case is handled in Step 1's error table.
|
|
35
|
+
|
|
36
|
+
When it happens, **stop** (it is not retryable from the CLI) and report to the user: (a) the **raw CLI error as-is** — the exact `name`/`errorCode` and `message` the CLI returned, verbatim — and (b) that they should **reach out to Salesforce support** to get the org enabled for trial-org creation, then try again. **Do NOT diagnose or name which permission is missing** — just surface the raw error and point them to support.
|
|
37
|
+
|
|
38
|
+
## Required Inputs — collect from the invoking user before any create
|
|
39
|
+
|
|
40
|
+
Prompt the user for these and do NOT proceed until all are provided. Do not invent values. **Ask for each one; if the user is unsure about a field, guide them using the "If the user is unsure" column before moving on.**
|
|
41
|
+
|
|
42
|
+
**Always required (5)** — these are `required="true"` on the `SignupRequest` entity (`FirstName` is listed here for prompting convenience but is **optional**):
|
|
43
|
+
|
|
44
|
+
| Input | Notes | If the user is unsure |
|
|
45
|
+
|-------|-------|-----------------------|
|
|
46
|
+
| `LastName` | Admin user's last name. Max 80 chars. | Any surname for the new org's admin user; it's just the admin contact name, use theirs. |
|
|
47
|
+
| `FirstName` | **Optional.** Admin user's first name. Ask for it, but proceed without it if the user doesn't provide one. | Optional — leave blank if unsure; only `LastName` is required for the admin user. |
|
|
48
|
+
| `Username` | Admin login username. Must be **email-format** and **globally unique** across all Salesforce orgs. Max 80 chars. Lowercased on save. | It does not have to be a real inbox — it just has to look like an email and be unique. Suggest a pattern like `admin@<company>-<something-unique>.com`. If it collides, you'll get a duplicate-username error on create; pick another. |
|
|
49
|
+
| `SignupEmail` | Admin user's **real** email address (welcome/login mail goes here). | This one must be a working inbox they can access — unlike `Username`, it should be a real address. |
|
|
50
|
+
| `Company` | Company / org name. Max 80 chars. | The organization name to show in the trial org; any descriptive name is fine. |
|
|
51
|
+
| `Country` | **ISO country code**, max 3 chars, e.g. `US`, `GB`, `IN`, `DE`. Validated at runtime against allowed codes (embargoed/invalid codes are rejected). | Use the 2-letter ISO code for their country (e.g. `US` for United States, `GB` for United Kingdom). Not a free-text country name. |
|
|
52
|
+
|
|
53
|
+
**Exactly one of (required, pick one — NOT both):**
|
|
54
|
+
|
|
55
|
+
| Input | Notes | If the user is unsure |
|
|
56
|
+
|-------|-------|-----------------------|
|
|
57
|
+
| `TemplateId` | Trialforce template ID (key prefix `0TT`, 15 chars) — defines the trial org's product/content. | Use a template when they want a specific pre-built product/content set. To find available templates, query the host org: `sf data query -o <HOST_ORG> -q "SELECT Id, TemplateName FROM TrialforceTemplate" --json`. If they just want a plain trial org, use `Edition` instead. |
|
|
58
|
+
| `Edition` | Org edition for a generic (non-template) trial. Generic values: `Developer`, `Group`, `Professional`, `Enterprise` (also `ServiceProfessional`, `SalesEnterprise`). Partner/Trialforce editions are perm-gated. | If they just want "a dev org to try things," use `Developer`. Partner editions (`PARTNER_*`, `TRIALFORCE_*`) only work if the host org has partner/TMC perms — using one without the perm returns a `noPartnerAccess` error. |
|
|
59
|
+
|
|
60
|
+
Ask the user to choose **either** a `TemplateId` **or** an `Edition`, not both:
|
|
61
|
+
- **Neither supplied** → stop and ask. A create with no template and no edition fails validation with `missingEdition` (`ApiErrorCodes.INVALID_SIGNUP_OPTION`).
|
|
62
|
+
- **Both supplied** → ask them to pick one; send only the chosen field. Combining them fails with `redundantTemplateId`. Neither may be combined with clone/source-org fields either.
|
|
63
|
+
|
|
64
|
+
This skill intentionally scopes user-collected input to the fields above (the 5 always-required plus optional `FirstName`). Do **not** prompt for or surface other fields. The `SignupRequest` entity supports additional optional and perm-gated fields (`TrialDays`, `Subdomain`, `PreferredLanguage`, `SignupSource`, the OAuth-return pair, etc.); these are **out of scope here** and left to server defaults. They are documented in `references/signup_request_fields.md` for reference only — do not send them from this skill.
|
|
65
|
+
|
|
66
|
+
## Step 1 — Create the SignupRequest
|
|
67
|
+
|
|
68
|
+
Invoke the create script with the collected inputs. It enforces the "exactly one of `TemplateId`/`Edition`" rule, assembles and quotes the `--values` payload, runs the insert, and prints the assigned `0SR…` id on success. Reference the script by its **absolute path** from the skill directory (`<skill_dir>/scripts/…`) — never `./scripts/`, which resolves against the user's working directory.
|
|
69
|
+
|
|
70
|
+
**With a template:**
|
|
71
|
+
```bash
|
|
72
|
+
SR_ID=$(bash "<skill_dir>/scripts/create_signup_request.sh" \
|
|
73
|
+
--target-org <HOST_ORG> \
|
|
74
|
+
--last-name <LAST_NAME> --email <EMAIL> --username <UNIQUE_USERNAME> \
|
|
75
|
+
--company "<COMPANY>" --country <ISO> --template-id 0TT... \
|
|
76
|
+
--output-dir force-app/main/adk-eval-output)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**With an edition (generic trial, no template):** replace `--template-id 0TT...` with `--edition Developer` (or `Enterprise`, etc.). Add `--first-name <NAME>` only if the user supplied it — no other optional fields are sent by this skill. The script rejects supplying both `--template-id` and `--edition`, or neither.
|
|
80
|
+
|
|
81
|
+
Pass `--output-dir` (use `force-app/main/adk-eval-output` when it exists) so that if the create is **rejected**, the script still writes `<output-dir>/signup-request-result.json` capturing the create-rejected outcome and the raw error verbatim — the run's output artifact even when no org is created. On success this write is done by the Step 2 read-back instead.
|
|
82
|
+
|
|
83
|
+
On success the script prints the `0SR…` SignupRequest id (capture it as `SR_ID`). Pass `--json` instead to get the raw `sf` create envelope, which wraps a **handle**, not the org:
|
|
84
|
+
```json
|
|
85
|
+
{ "status": 0, "result": { "id": "0SRxx0000000000", "success": true, "errors": [] } }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Handle create errors (synchronous field validation).** On a rejected create the script exits non-zero and prints the **raw CLI error** (`name`/`code` + `message`) to stderr — surface it verbatim and act per the table below. When `--output-dir` was given, the script also writes the create-rejected artifact (`{ "outcome": "create-rejected", "error": {…}, "CreatedOrgId": null, "Status": null }`) to `<output-dir>/signup-request-result.json`; do not hand-author this file. This is field validation, returned *immediately* — distinct from the async `ErrorCode` in Step 2. These are **server-side** rejections (the record reaches the org and the platform rejects it at insert time) — do not describe them to the user as "client-side"; the CLI does not validate email/country format, picklist values, or field length locally. Do NOT poll a create that failed, and do NOT proceed to Step 2.
|
|
89
|
+
|
|
90
|
+
| Failure | Meaning → what to tell the user |
|
|
91
|
+
|---------|---------------------------------|
|
|
92
|
+
| `missingEdition` / `INVALID_SIGNUP_OPTION` | Neither `TemplateId` nor `Edition` was sent — ask for one and retry. |
|
|
93
|
+
| `redundantTemplateId` | Both `TemplateId` and `Edition` were sent — drop one and retry. |
|
|
94
|
+
| `noPartnerAccess` / `NO_PARTNER_PERMISSION` | A partner/TSO edition was requested but the host org lacks the perm — use a generic edition (`Developer`, etc.) or get the perm. |
|
|
95
|
+
| duplicate / invalid `Username` (`INVALID_EMAIL_ADDRESS`) | `Username` is not email-format or not globally unique — ask for a different one and retry. |
|
|
96
|
+
| `INVALID_SIGNUP_COUNTRY` | `Country` is not a valid/allowed ISO code — fix and retry. |
|
|
97
|
+
| `INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST` | `Edition` is not an accepted value for the host org's restricted picklist (e.g. `Ultimate`) — pick a valid generic edition and retry. |
|
|
98
|
+
| `STRING_TOO_LONG` | A field value exceeds its max length (the message names the field + `max length`, e.g. `LastName` over 80) — shorten it and retry. |
|
|
99
|
+
| `subdomainInUse` / invalid subdomain | Chosen `Subdomain` is taken or invalid — pick another. |
|
|
100
|
+
| `NOT_FOUND` ("The requested resource does not exist") or `INVALID_TYPE` ("sObject type 'SignupRequest' is not supported") | The `SignupRequest` entity is not exposed → the org is not entitled to create trial orgs. **Not** retryable. Stop and surface the **raw CLI error as-is** (`name`/`errorCode` + `message`), then tell the user to **reach out to Salesforce support** to get the org enabled. **Do not name or diagnose the missing permission.** |
|
|
101
|
+
| `INSUFFICIENT_ACCESS_OR_READONLY` | The entity is exposed but the *user* lacks the access to create the record — a user-permission problem, distinct from the org-entitlement failure above. Fix the user's permissions and retry. |
|
|
102
|
+
|
|
103
|
+
For the full catalog and prefixes → `references/error_codes.md`.
|
|
104
|
+
|
|
105
|
+
- For the full required/optional field list, types, and perm-gated fields → load `references/signup_request_fields.md`.
|
|
106
|
+
- Do NOT send `TemplateId` together with clone/source-org fields (`redundantTemplateId` error). Do NOT request a partner/Trialforce edition without the host org's partner/TMC perm.
|
|
107
|
+
|
|
108
|
+
## Step 2 — Read the request once the org id is available (creation is async)
|
|
109
|
+
|
|
110
|
+
Provisioning happens asynchronously after the insert, so re-read the record to pick up the assigned org id. Invoke the read script — it applies a fixed, bounded read-back policy internally (stopping as soon as `CreatedOrgId` is populated or the status is terminal, and never polling indefinitely), prints the record as JSON, and writes the output artifact when `--output-dir` is given. Then act on the script's **exit code** (below) — the retry count and delay are the script's own deterministic logic; you do not re-implement or re-count them in prose. If the org id is not yet available, the script exits `3` so you can hand the request id back to the user:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
bash "<skill_dir>/scripts/get_signup_request.sh" \
|
|
114
|
+
--target-org <HOST_ORG> --id "$SR_ID" [--output-dir <DIR>]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The script prints the `SignupRequest` record (the `sf` envelope's `result`) as JSON. Read these fields from it:
|
|
118
|
+
- `CreatedOrgId` — the new trial org id (`00D…`, 15 chars). Populated as soon as the org is allocated (often while `Status` is still `InProgress`); this is the script's stop signal.
|
|
119
|
+
- `CreatedOrgInstance` — instance hosting the new org (target follow-up calls here).
|
|
120
|
+
- `Username` — the admin login username on the record. Report the value **read back from the record**, not the raw input — it is lowercased on save, so the stored value is the accurate one to hand the user.
|
|
121
|
+
- `Status` — lifecycle `New` → `InProgress` → `Success` | `Error` (match case-insensitively).
|
|
122
|
+
- `LoginUrl` — present only if `IsSyncLogin` was set on create (perm-gated).
|
|
123
|
+
- `AuthCode` — present only if `ConnectedAppConsumerKey` + `ConnectedAppCallbackUrl` were set.
|
|
124
|
+
- `ErrorCode` — populated **only when `Status = Error`**. This is the *async provisioning* error (distinct from the synchronous create-time validation in Step 1), prefixed:
|
|
125
|
+
- `C-` org creation error · `S-` signup data error · `T-` template error (e.g. `T-0002` = template not found) · `SH-` org-shape error · `VR-` version-selection error · `X-0001`/`X-0002` fatal/should-never-happen.
|
|
126
|
+
|
|
127
|
+
Act on the script's exit code. **The org id lookup runs first — do not report anything to the user until the script returns.** Report only what is actually on the record; never invent or relabel the `Status`:
|
|
128
|
+
- **`0`** — `CreatedOrgId` is populated. Proceed to Step 3 and report the org id together with the record's real `Status` and the `Username`.
|
|
129
|
+
- **`3` — no org id available yet (not an error).** The org has not been allocated. The script has already exhausted its bounded read-back — **do NOT re-invoke it in a loop to keep polling.** Report the **SignupRequest id (`0SR…`)**, the record's **`Status` exactly as returned**, and the `Username`; tell the user the org id is not available yet, and let them re-check later (see Step 3).
|
|
130
|
+
- **`1`** — `Status = Error` (stop and report the `ErrorCode` and its prefix meaning via `references/error_codes.md`; the org was not created), or the read itself failed (auth expired, `0SR` id not found) — surface the raw CLI error and stop.
|
|
131
|
+
|
|
132
|
+
## Step 3 — Report details and hand off status checks
|
|
133
|
+
|
|
134
|
+
Report **after** the Step 2 lookup returns — not before. When the user asks to create (or re-check) the org, run the read-back first and wait for it, then report all available details to the user in one go. Report **only what is on the record**; never fabricate or relabel a value — especially `Status`, which must be the exact string the response object carries:
|
|
135
|
+
- **SignupRequest id** — the `0SR…` request id (from Step 1). **Always report this** — it is the handle the user (or a later check) uses to look the request up again, and it is the primary thing to hand back if the org id is not yet available.
|
|
136
|
+
- **CreatedOrgId** — the new trial org id (`00D…`), when populated. If the read returned exit `3` (org id not yet available), say so plainly: the request was accepted and the org is still being provisioned; there is no org id to share *yet*.
|
|
137
|
+
- **CreatedOrgInstance** — the instance hosting it, if present.
|
|
138
|
+
- **Username** — the admin login username **as stored on the record** (lowercased on save). Always report this — it is what the user logs in with once the org is ready.
|
|
139
|
+
- **Status** — the `Status` value **exactly as it appears on the record**. Echo whatever string the response carries; do not map, translate, infer, or pick from a fixed list. A still-pending status is normal at this point — provisioning finishes in the background.
|
|
140
|
+
- **LoginUrl** / **AuthCode** — only if present.
|
|
141
|
+
|
|
142
|
+
Also tell the user that **login details for the new org arrive by email** — once provisioning completes, a welcome/login email is sent to the `SignupEmail` address, so they should watch that inbox to finish logging in. (This is why `SignupEmail` must be a real, accessible address.)
|
|
143
|
+
|
|
144
|
+
Then suggest, in plain language, how the user can re-check status later — provisioning may still be completing. Tell them they can just ask (the skill re-reads the record), for example:
|
|
145
|
+
- "Check the status of my trial org **`00D…`**" (by the org id), or
|
|
146
|
+
- "Check the status of signup request **`0SR…`**" (by the SignupRequest id).
|
|
147
|
+
|
|
148
|
+
Both resolve to a re-run of the Step 2 read script against the same `SignupRequest` record (the org id is looked up on that record). A later check should report the current `Status` **exactly as returned** on the record. If the record comes back with an error status, also report the `ErrorCode` and its prefix meaning via `references/error_codes.md`.
|
|
149
|
+
|
|
150
|
+
**Output artifact.** Write the current `SignupRequest` record as the run's output artifact by passing `--output-dir` to the Step 2 read script — the script writes `<output-dir>/signup-request-result.json` (creating the directory if needed). Use `force-app/main/adk-eval-output` as the output directory when it exists:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
bash "<skill_dir>/scripts/get_signup_request.sh" \
|
|
154
|
+
--target-org <HOST_ORG> --id "$SR_ID" \
|
|
155
|
+
--output-dir force-app/main/adk-eval-output
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
This is the run's defined output — do not ask permission before writing it.
|
|
159
|
+
|
|
160
|
+
## Reference File Index
|
|
161
|
+
|
|
162
|
+
| File | When to read |
|
|
163
|
+
|------|-------------|
|
|
164
|
+
| `references/signup_request_fields.md` | Full field reference — required/optional fields, types, defaults, perm-gated fields, editions |
|
|
165
|
+
| `references/error_codes.md` | Interpreting `ErrorCode` prefixes and common validation failures |
|
|
166
|
+
|
|
167
|
+
## Example Files
|
|
168
|
+
|
|
169
|
+
Load these only when you need to see the concrete shape of a payload or response — they are illustrative samples with placeholder ids (`0SRxx…`, `00Dxx…`), not values to send.
|
|
170
|
+
|
|
171
|
+
| File | When to read |
|
|
172
|
+
|------|-------------|
|
|
173
|
+
| `examples/create_request.json` | When assembling the create — to confirm the field names/shape of the `SignupRequest` create payload |
|
|
174
|
+
| `examples/success_response.json` | When interpreting a successful create + read-back — shows the record once `CreatedOrgId` is populated |
|
|
175
|
+
| `examples/error_response.json` | When interpreting a rejected create — shows the shape of common validation/error responses |
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment_validation": "Field-validation rejections (e.g. redundant/missing Edition) are returned synchronously by the create API. The CLI flattens the underlying sObject errors[] into the message string and sets result:null; the error code lands in name/code. There is no top-level result.errors[] on failure.",
|
|
3
|
+
"insertTimeValidationError": {
|
|
4
|
+
"status": 1,
|
|
5
|
+
"name": "INVALID_SIGNUP_OPTION",
|
|
6
|
+
"code": "INVALID_SIGNUP_OPTION",
|
|
7
|
+
"message": "Failed to create record. \nErrors:\n TemplateId and Edition cannot both be specified; send exactly one.",
|
|
8
|
+
"result": null
|
|
9
|
+
},
|
|
10
|
+
"missingEditionError": {
|
|
11
|
+
"status": 1,
|
|
12
|
+
"name": "INVALID_SIGNUP_OPTION",
|
|
13
|
+
"code": "INVALID_SIGNUP_OPTION",
|
|
14
|
+
"message": "Failed to create record. \nErrors:\n You must specify either an Edition or a TemplateId.",
|
|
15
|
+
"result": null
|
|
16
|
+
},
|
|
17
|
+
"_comment_missingOrgPerm": "Host org is not entitled to create trial orgs, so the SignupRequest entity is not exposed. The create API rejects it and the CLI emits a non-zero status with name/code NOT_FOUND (create REST path) or INVALID_TYPE (query path) and result:null. This is NOT retryable from the CLI; surface the raw error and point the user to Salesforce support.",
|
|
18
|
+
"missingOrgPermError": {
|
|
19
|
+
"status": 1,
|
|
20
|
+
"name": "NOT_FOUND",
|
|
21
|
+
"code": "NOT_FOUND",
|
|
22
|
+
"message": "The requested resource does not exist",
|
|
23
|
+
"result": null
|
|
24
|
+
},
|
|
25
|
+
"missingOrgPermViaQueryError": {
|
|
26
|
+
"status": 1,
|
|
27
|
+
"name": "INVALID_TYPE",
|
|
28
|
+
"code": "INVALID_TYPE",
|
|
29
|
+
"message": "sObject type 'SignupRequest' is not supported.",
|
|
30
|
+
"result": null
|
|
31
|
+
},
|
|
32
|
+
"asyncProvisioningError": {
|
|
33
|
+
"status": 0,
|
|
34
|
+
"result": {
|
|
35
|
+
"Id": "0SRxx0000000000",
|
|
36
|
+
"Status": "Error",
|
|
37
|
+
"CreatedOrgId": null,
|
|
38
|
+
"ErrorCode": "S-0007"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"createResponse": {
|
|
3
|
+
"status": 0,
|
|
4
|
+
"result": {
|
|
5
|
+
"id": "0SRxx0000000000",
|
|
6
|
+
"success": true,
|
|
7
|
+
"errors": []
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"_comment_polledResult": "Re-read of the SignupRequest after insert. The skill stops and reports as soon as CreatedOrgId is populated — this often happens while Status is still InProgress (provisioning finishes in the background). The user re-checks status later by org id or 0SR request id.",
|
|
11
|
+
"polledResult": {
|
|
12
|
+
"status": 0,
|
|
13
|
+
"result": {
|
|
14
|
+
"attributes": {
|
|
15
|
+
"type": "SignupRequest"
|
|
16
|
+
},
|
|
17
|
+
"Id": "0SRxx0000000000",
|
|
18
|
+
"Status": "InProgress",
|
|
19
|
+
"CreatedOrgId": "00Dxx0000000000",
|
|
20
|
+
"CreatedOrgInstance": "USA1",
|
|
21
|
+
"ResolvedTemplateId": "0TTxx0000000000",
|
|
22
|
+
"LoginUrl": null,
|
|
23
|
+
"AuthCode": null,
|
|
24
|
+
"ErrorCode": null
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# SignupRequest Error Codes
|
|
2
|
+
|
|
3
|
+
There are **two distinct error systems** for `SignupRequest`:
|
|
4
|
+
|
|
5
|
+
1. **Synchronous field validation** — returned immediately on `sf data create record` (non-zero `status`; the CLI puts the code in `name`/`code` and flattens the underlying sObject `errors[]` into the `message` string, with `result: null`). **These are server-side rejections**: the record *is* sent to the org, and the platform rejects it at insert time — both the SignupRequest-specific validators (`missingEdition`, `redundantTemplateId`, `INVALID_EMAIL_ADDRESS`, `INVALID_SIGNUP_COUNTRY`) and the generic UDD field constraints enforced on any sObject write (`STRING_TOO_LONG` for a value over a field's max length, `INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST` for a bad `Edition` value). Do **not** describe these as "client-side" — the CLI does not enforce field length, picklist values, or email/country format locally; the server does. Source: validator classes under `core/signup-request/java/src/sfdc/signup/validation/` (SignupRequest-specific) plus core UDD field validation (generic). The client-side pre-checks are only those the create script itself performs before calling `sf` — a dependency check (`sf`/`jq` on PATH), required-field presence, the "exactly one of `TemplateId`/`Edition`" rule, and the both-quote-styles guard — all of which exit non-zero *without* contacting the org. None of them validate a value's **content** (length, picklist membership, email/country format); that is always server-side.
|
|
6
|
+
2. **Asynchronous provisioning failure** — surfaced only while polling, as `result.Status = Error` with a `result.ErrorCode` (max 8 chars, prefixed). Source: `core/signup-request-api/java/src/sfdc/signup/SignupRequestErrorCodes.java`. Human-readable messages come from `LabelRef`s in the `SignupRequestErrors` label section.
|
|
7
|
+
|
|
8
|
+
The prefix table below is the **async `ErrorCode`** (system 2). The common-failures table mixes both, labeled by when each surfaces.
|
|
9
|
+
|
|
10
|
+
## Error code prefixes
|
|
11
|
+
|
|
12
|
+
| Prefix | Category |
|
|
13
|
+
|---|---|
|
|
14
|
+
| `C-` | Org-creation failure |
|
|
15
|
+
| `S-` | Signup-data failure |
|
|
16
|
+
| `T-` | Template failure |
|
|
17
|
+
| `SH-` | Shape failure |
|
|
18
|
+
| `VR-` | Version-selection failure |
|
|
19
|
+
| `X-0001` / `X-0002` | Fatal "should never happen" errors |
|
|
20
|
+
|
|
21
|
+
## Common failures (surfaced at insert time in the create envelope's `name`/`message`)
|
|
22
|
+
|
|
23
|
+
| Symptom | Likely cause / fix |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `NOT_FOUND` ("The requested resource does not exist") or `INVALID_TYPE` ("sObject type 'SignupRequest' is not supported") | The `SignupRequest` entity is not exposed → the org is not entitled to create trial orgs. Not retryable. Surface the **raw CLI error as-is** and tell the user to **reach out to Salesforce support** to get the org enabled — do not name or diagnose the missing permission. |
|
|
26
|
+
| `INSUFFICIENT_ACCESS_OR_READONLY` | Entity is exposed but the *user* lacks the access to create the record — a user-perm problem; fix the user's permissions and retry. |
|
|
27
|
+
| `missingEdition` (`INVALID_SIGNUP_OPTION`) | Neither `TemplateId` nor `Edition` supplied — send exactly one |
|
|
28
|
+
| `redundantTemplateId` (`INVALID_SIGNUP_OPTION`) | Both `TemplateId` and `Edition` supplied — send only one |
|
|
29
|
+
| `noPartnerAccess` (`NO_PARTNER_PERMISSION`) | A partner/Trialforce edition requested but host org lacks partner/TMC perm — use a generic edition |
|
|
30
|
+
| clone/source + template/edition | Clone (`CloneFromOrg`) or source-org signup must not also send `TemplateId`/`Edition` |
|
|
31
|
+
| Invalid username (`INVALID_EMAIL_ADDRESS`) | Username not email-format, or not globally unique (duplicate) — ask for a different one and retry |
|
|
32
|
+
| `INVALID_SIGNUP_COUNTRY` | `Country` not a valid/allowed ISO code (embargoed or malformed) — fix and retry |
|
|
33
|
+
| `INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST` | `Edition` is not an accepted value for the host org's restricted `Edition` picklist (e.g. `Ultimate`, or a partner value the org can't use) — pick a valid generic edition (`Developer`, `Enterprise`, …) and retry |
|
|
34
|
+
| `STRING_TOO_LONG` | A text field exceeds its max length (e.g. `LastName`/`Company`/`Username` over 80 chars) — the message names the field and `max length` — shorten it and retry. Server-side, **not** a client-side check. |
|
|
35
|
+
| Invalid / not-found `TemplateId` | `0TT` template id wrong or not visible to host org. **Note: this is validated asynchronously, not at insert** — a well-formed but nonexistent `0TT` inserts successfully (`status: 0`) and surfaces later on read-back as `Status = Error` with a `T-` `ErrorCode` (e.g. `T-0002`). Handle it in Step 2, not as a create-time rejection. |
|
|
36
|
+
| `subdomainInUse` / invalid subdomain | Requested `Subdomain` taken or malformed |
|
|
37
|
+
| `dailyLimitExceeded` / `activeScratchLimitExceeded` | Daily/active signup rate limit hit for the host org |
|
|
38
|
+
|
|
39
|
+
## Handling in the skill
|
|
40
|
+
|
|
41
|
+
- Insert-time validation failures come back from `sf data create record` as a non-zero `status` with the code in `name`/`code` and the detail flattened into `message` (`result: null`) — report the message and stop.
|
|
42
|
+
- Async provisioning failures show up on polling (`sf data get record`) as `result.Status = Error` with a `result.ErrorCode` — report the code + category and stop polling.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SignupRequest Field Reference
|
|
2
|
+
|
|
3
|
+
Trial-org creation is performed by inserting a **`SignupRequest`** sObject (key prefix `0SR`, `minApiVersion` 182). Source of truth: `core/udd-xml/java/resources/udd/SignupRequest.entity.xml` in the core repo (`gitcore.soma.salesforce.com/core-2206/core-266-public`). Owned by the **Signup and ISV Tools** team.
|
|
4
|
+
|
|
5
|
+
## Required fields
|
|
6
|
+
|
|
7
|
+
| Field | Type | Meaning / Notes |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `LastName` | Text(80) | Admin user last name |
|
|
10
|
+
| `Username` | Text(80) | Admin username. Globally unique, must be email-format. Lowercased on set. |
|
|
11
|
+
| `SignupEmail` | Email | Admin user email |
|
|
12
|
+
| `Company` | Text(80) | Company / org name |
|
|
13
|
+
| `Country` | Text(3) | ISO country code (e.g. `US`). `DefaultSignupRequest` defaults to `US`. |
|
|
14
|
+
|
|
15
|
+
## Common optional fields
|
|
16
|
+
|
|
17
|
+
| Field | Type | Meaning |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `FirstName` | Text | Admin first name |
|
|
20
|
+
| `TemplateId` | Text(15) | Trialforce Template ID (`0TT…`) — the trial product/template to clone |
|
|
21
|
+
| `Edition` | StaticEnum `Edition` (minApi 198) | Org edition, e.g. `Developer`, `Enterprise`/`PlanOrgEE`, `PlanOrgPE`, `PlanOrgDE`. Mutually exclusive with clone/source-org. Confirm exact API values against `udd-*.xml` if enumerating. |
|
|
22
|
+
| `TrialDays` | Integer | Days until trial expiry. Resolved server-side post-commit if not set. |
|
|
23
|
+
| `PreferredLanguage` | StaticEnum `Language` (minApi 198) | Default locale. Invalid values silently scrubbed (`scrubLanguageField`). Default `en_US`. |
|
|
24
|
+
| `Subdomain` | Text (minApi 186) | Requested My Domain subdomain |
|
|
25
|
+
| `ConnectedAppConsumerKey` | Text(120) (minApi 184) | Return an OAuth auth code for this Connected App |
|
|
26
|
+
| `ConnectedAppCallbackUrl` | StringPlusClob(2000) (minApi 184) | OAuth callback URL |
|
|
27
|
+
| `IsSignupEmailSuppressed` | Boolean (minApi 186) | Suppress welcome email. Server default applied if not explicitly set. |
|
|
28
|
+
| `SignupSource` | Text(60) (minApi 200) | Free-text signup source tag |
|
|
29
|
+
|
|
30
|
+
## Perm-gated / advanced fields
|
|
31
|
+
|
|
32
|
+
Require additional org/user permissions; only set when the host org is entitled.
|
|
33
|
+
|
|
34
|
+
| Field | Type | Gate |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| `IsSyncLogin` | Boolean (minApi 194) | `SignupRequestSyncLogin` perm. Synchronous login; populates `LoginUrl`. |
|
|
37
|
+
| `IsTso` | Boolean (minApi 200) | `isHubMasterAndPartner` / TMO |
|
|
38
|
+
| `ShouldConnectToEnvHub` | Boolean (minApi 198) | Env Hub membership |
|
|
39
|
+
| `CloneFromOrg` | Text(15) (minApi 204) | Clone from existing org (Env Hub / Sayonara) |
|
|
40
|
+
| `AuthProviderType` | StaticEnum (minApi 236) | `SocialSignup` perm |
|
|
41
|
+
| `Instance` | Text(8) (minApi 210) | `SetSignupDestination` perm — force target instance |
|
|
42
|
+
| `EmailBrandId` / `LoginBrandId` | Text(15) (minApi 202) | TMO-only branding |
|
|
43
|
+
| `ArtifactAncestors` | StringPlusClob(2000) (minApi 206) | Perm-gated artifact ancestry |
|
|
44
|
+
| `InternalForceSync` | Boolean (minApi 202) | Internal/test only (`isDevInternal`/`isUiTier`) |
|
|
45
|
+
| `TrialSourceOrgId` | Text(15) | System-set, read-only |
|
|
46
|
+
|
|
47
|
+
## System-set / read-only output fields
|
|
48
|
+
|
|
49
|
+
`createAccess="UserType.AUTOMATED_PROCESS;isDevInternal"` — you read these back from the record after create, you do not set them:
|
|
50
|
+
|
|
51
|
+
`Status`, `ErrorCode`, `CreatedOrgId`, `CreatedOrgInstance`, `ResolvedTemplateId`, `TemplateDescription`, `AuthCode`, `LoginUrl`.
|
|
52
|
+
|
|
53
|
+
## Validation rules to respect
|
|
54
|
+
|
|
55
|
+
- Send **exactly one** of `Edition` or `TemplateId`. Both → `redundantTemplateId`; neither → `missingEdition` (both under `ApiErrorCodes.INVALID_SIGNUP_OPTION`).
|
|
56
|
+
- `TemplateId`/`Edition` cannot coexist with clone (`CloneFromOrg`) or source-org fields.
|
|
57
|
+
- Partner/Trialforce editions require the host org's partner/TMC perm → otherwise `noPartnerAccess`.
|
|
58
|
+
- Daily / active signup rate limits (`dailyLimitExceeded`, `activeScratchLimitExceeded`).
|
|
59
|
+
- Invalid username (email-format + globally unique) / country (ISO code) / templateId (`0TT`) / subdomain; subdomain-in-use.
|
|
60
|
+
- **Terms / subscription-agreement acceptance is NOT a field on this sObject** — it is enforced at the higher-level WebForm / `SignupConfigItem` layer (public developer signup forms). This skill targets the authenticated `SignupRequest` sObject path, not the public web-form config layer.
|
|
61
|
+
|
|
62
|
+
## Authentication summary
|
|
63
|
+
|
|
64
|
+
- Not public/unauthenticated. Authenticate as a user in a **host org**.
|
|
65
|
+
- Org gate: the host org must be **entitled to create trial orgs**. The `SignupRequest` entity is only exposed on an entitled org.
|
|
66
|
+
- The skill does not run a separate entitlement check — the `sf data create record` call is the definitive gate. On an unentitled org the entity is not exposed and the create fails with `NOT_FOUND` or `INVALID_TYPE`; surface the raw CLI error and point the user to Salesforce support — do not diagnose the missing permission. (Entity accessibility does map exactly to entitlement, so a `SELECT Id FROM SignupRequest LIMIT 1` probe would work as a fail-fast check, but it only duplicates the create-time gate.)
|
|
67
|
+
- User gate: the invoking user must be authenticated and have sufficient access on the host org to create the record.
|
|
68
|
+
- Auth: log into the host org once with `sf org login web` (or `sf org login`), then reference it by username or alias with `--target-org` (`-o`) on each `sf data create record` / `sf data get record` call. The CLI carries the auth for you.
|
|
69
|
+
- Always pass `-o` explicitly and confirm the target host org with the user first. Without `-o` the CLI falls back to the configured default org (`target-org` config / `SF_TARGET_ORG`), or errors with `NoDefaultEnvError` if none is set — it never auto-selects among connected orgs. The default may be an unrelated org, so an omitted `-o` risks provisioning against the wrong org. Verify the chosen org shows `Connected` in `sf org list`.
|