Salesforce CLI Command Reference
Release Notes
Deprecation Policy
schema generate field
schema generate platformevent
schema generate sobject
schema generate tab
Generate metadata source files for a new platform event.
This command is interactive and must be run in a Salesforce DX project directory. You’re required to specify the event’s label with the “–label” flag. The command uses this label to provide intelligent suggestions for other event properties, such as its API name.
generate:metadata:platformevent
| Flag Name (Long) | Flag Name (Short) | Description |
|---|---|---|
‑‑flags‑dir | N/A | Type: Value Import flag values from a directory. |
‑‑label | ‑l | Type: Value Required The platform event’s label. |
Create a platform event with the specified label:
1sf schema generate platformevent --label "My Platform Event"