Skip to content

forcedotcom/sf-skills / skills/data360-code-extension-generate

data360-code-extension-generate

Verified

Create, develop, test, and deploy Data 360 (Data Cloud) Code Extensions with the sf CLI data-code-extension plugin and the salesforce-data-customcode Python SDK. Use this skill when creating or writing a code extension script or function (for example one that reads a DLO and writes a DLO), creating custom PySpark transformations for Data 360, editing an existing code extension payload/entrypoint.py, setting up a local code extension environment, scanning, running locally, deploying, or redeploying code extensions. Supports environment setup, init, scan, run, zip, and deploy for script and function packages.

FileKindSize
SKILL.mdskill md17.0 KB
references/README.mdmarkdown3.2 KB
references/environment-setup.mdmarkdown10.5 KB
references/mcp-integration.mdmarkdown3.6 KB
references/quick-reference.mdmarkdown7.1 KB
references/run-logs.mdmarkdown2.3 KB
references/schema-discovery.mdmarkdown2.7 KB
references/troubleshooting.mdmarkdown9.0 KB
scripts/check_env.shexecutablescript10.2 KB
scripts/venv_hook.shexecutablescript888 B

references/run-logs.md

View on GitHub
# Reading a Deployed Run's Logs (`DataCustomCodeLogs__dll`)

Everything the deployed code prints or logs, including uncaught exceptions and tracebacks, is written to the system DLO **`DataCustomCodeLogs__dll`**, one row per message. Check it after every run (SKILL.md Phase 7), whether the run succeeded or failed.

| Field | Meaning |
|---|---|
| `DataCustomCodeName__c` | Name of the code extension (the deploy `--name`). Filter on this |
| `ExecutionId__c` | One value per run. All rows of a run share it |
| `Timestamp__c` | When the message was written. The newest rows are the latest run |
| `Message__c` | The printed or logged text, or the exception |

## Latest run

This returns every message from the **latest run** of `<name>`, in order. When the Data 360 MCP server is available, send the same SQL with its `d360_query_sql` tool first; use this command as the fallback:

```bash
sf api request rest "/services/data/v<API_VERSION>/ssot/query-sql" --method POST --target-org <ORG_ALIAS> --body - <<'EOF' \
  | jq -r '"rows: \(.returnedRows)", (.data[] | "\(.[0])  \(.[2])")'
{"sql": "SELECT Timestamp__c, ExecutionId__c, Message__c FROM DataCustomCodeLogs__dll WHERE DataCustomCodeName__c = '<name>' AND ExecutionId__c = (SELECT ExecutionId__c FROM DataCustomCodeLogs__dll WHERE DataCustomCodeName__c = '<name>' ORDER BY Timestamp__c DESC LIMIT 1) ORDER BY Timestamp__c"}
EOF
```

`--body -` reads the JSON request from the quoted heredoc, so the command needs no `$(…)`. Keep `<name>` free of `"` and `'`.

## Reading the rows

- Confirm the run is the one you just started: the newest `Timestamp__c` should be after you clicked Run Now. Log rows can take a few minutes to appear. If there are none, or only an older run's rows, wait and query again.
- Look in `Message__c` for `Traceback`, `Error` or `Exception` lines. They give the failing line in `entrypoint.py`.
- To see the last few runs at a glance, send this SQL the same way: `SELECT ExecutionId__c, MIN(Timestamp__c), MAX(Timestamp__c), COUNT(*) FROM DataCustomCodeLogs__dll WHERE DataCustomCodeName__c = '<name>' GROUP BY ExecutionId__c ORDER BY 2 DESC LIMIT 5`.
- In the UI, use **Data Explorer**: choose `DataCustomCodeLogs__dll` and filter on `DataCustomCodeName__c`.
- Add `print()` or `logging` calls to the code to trace a deployed run, then redeploy. Local `run` prints to the terminal instead.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall