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‑dirN/AType: Value

Import flag values from a directory.
‑‑input‑directory‑iType: Value
Default value: force-app/main/default/objects

Directory from which to get the custom metadata type definition from.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑label‑lType: Value

Label for the new record.
‑‑output‑directory‑dType: Value
Default value: force-app/main/default/customMetadata

Directory to store newly-created custom metadata record files.
‑‑protected‑pType: Value
Valid Values: true, false
Default value: false

Protect 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‑nType: Value
Required

Name of the new record.
‑‑type‑name‑tType: 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: