cmdt generate record
Generate a new record for a given custom metadata type in the current project.
The custom metadata type must already exist in your project. You must specify a name for the new record. Use name=value pairs to specify the values for the fields, such as MyTextField=“some text here” or MyNumberField=32.
force:cmdt:record:create
cmdt:record:create
| Flag Name (Long) | Flag Name (Short) | Description |
|---|---|---|
‑‑flags‑dir | N/A | Type: Value Import flag values from a directory. |
‑‑input‑directory | ‑i | Type: Value Default value: force-app/main/default/objectsDirectory from which to get the custom metadata type definition from. |
‑‑json | N/A | Type: Boolean Format output as json. |
‑‑label | ‑l | Type: Value Label for the new record. |
‑‑output‑directory | ‑d | Type: Value Default value: force-app/main/default/customMetadataDirectory to store newly-created custom metadata record files. |
‑‑protected | ‑p | Type: Value Valid Values: true, falseDefault value: falseProtect the record when it’s in a managed package. Protected records can only be accessed by code in the same managed package namespace. |
‑‑record‑name | ‑n | Type: Value Required Name of the new record. |
‑‑type‑name | ‑t | Type: Value Required API name of the custom metadata type to create a record for; must end in “__mdt”. |
Create a record metadata file for custom metadata type ‘MyCMT’ with specified values for two custom fields:
Create a protected record metadata file for custom metadata type ‘MyCMT’ with a specific label and values specified for two custom fields: