@salesforce/plugin-custom-metadata 2.2.5 → 2.2.6
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/README.md +235 -159
- package/oclif.lock +35 -23
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -71,259 +71,335 @@ sfdx plugins
|
|
|
71
71
|
|
|
72
72
|
<!-- commands -->
|
|
73
73
|
|
|
74
|
-
- [`sfdx
|
|
75
|
-
- [`sfdx
|
|
76
|
-
- [`sfdx
|
|
77
|
-
- [`sfdx
|
|
78
|
-
- [`sfdx
|
|
74
|
+
- [`sfdx cmdt:generate:field`](#sfdx-cmdtgeneratefield)
|
|
75
|
+
- [`sfdx cmdt:generate:fromorg`](#sfdx-cmdtgeneratefromorg)
|
|
76
|
+
- [`sfdx cmdt:generate:object`](#sfdx-cmdtgenerateobject)
|
|
77
|
+
- [`sfdx cmdt:generate:record`](#sfdx-cmdtgeneraterecord)
|
|
78
|
+
- [`sfdx cmdt:generate:records`](#sfdx-cmdtgeneraterecords)
|
|
79
79
|
|
|
80
|
-
## `sfdx
|
|
80
|
+
## `sfdx cmdt:generate:field`
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Generate a field for a custom metadata type based on the provided field type.
|
|
83
83
|
|
|
84
84
|
```
|
|
85
85
|
USAGE
|
|
86
|
-
$ sfdx
|
|
87
|
-
|
|
86
|
+
$ sfdx cmdt:generate:field -n <value> -f
|
|
87
|
+
Checkbox|Date|DateTime|Email|Number|Percent|Phone|Picklist|Text|TextArea|LongTextArea|Url [--json] [-p <value>] [-s
|
|
88
|
+
<value>] [-l <value>] [-d <value>]
|
|
88
89
|
|
|
89
90
|
FLAGS
|
|
90
|
-
-d, --
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
--
|
|
101
|
-
this command invocation
|
|
91
|
+
-d, --output-directory=<value> Directory to store newly-created field definition files.
|
|
92
|
+
-f, --type=<option> (required) Type of the field.
|
|
93
|
+
<options: Checkbox|Date|DateTime|Email|Number|Percent|Phone|Picklist|Text|TextArea|L
|
|
94
|
+
ongTextArea|Url>
|
|
95
|
+
-l, --label=<value> Label for the field.
|
|
96
|
+
-n, --name=<value> (required) Unique name for the field.
|
|
97
|
+
-p, --picklist-values=<value>... Picklist values; required for picklist fields.
|
|
98
|
+
-s, --decimal-places=<value> Number of decimal places to use for number or percent fields.
|
|
99
|
+
|
|
100
|
+
GLOBAL FLAGS
|
|
101
|
+
--json Format output as json.
|
|
102
102
|
|
|
103
103
|
DESCRIPTION
|
|
104
|
-
|
|
104
|
+
Generate a field for a custom metadata type based on the provided field type.
|
|
105
|
+
|
|
106
|
+
Similar to a custom object, a custom metadata type has a list of custom fields that represent aspects of the metadata.
|
|
107
|
+
|
|
108
|
+
This command creates a metadata file that describes the new custom metadata type field. By default, the file is
|
|
109
|
+
created in a "fields" directory in the current directory. Use the --output-directory to generate the file in the
|
|
110
|
+
directory that contains the custom metadata type metdata files, such as "force-app/main/default/objects/MyCmdt__mdt"
|
|
111
|
+
for the custom metadata type called MyCmdt.
|
|
112
|
+
|
|
113
|
+
ALIASES
|
|
114
|
+
$ sfdx force:cmdt:field:create
|
|
115
|
+
$ sfdx cmdt:field:create
|
|
105
116
|
|
|
106
117
|
EXAMPLES
|
|
107
|
-
|
|
118
|
+
Generate a metadata file for a custom checkbox field and add the file to the MyCmdt__mdt/fields directory:
|
|
119
|
+
|
|
120
|
+
$ sfdx cmdt:generate:field --name MyCheckboxField --type Checkbox --output-directory \
|
|
121
|
+
force-app/main/default/objects/MyCmdt__mdt
|
|
122
|
+
|
|
123
|
+
Generate a metadata file for a custom picklist field and add a few values:
|
|
124
|
+
|
|
125
|
+
$ sfdx cmdt:generate:field --name MyPicklistField --type Picklist --picklist-values A --picklist-values B \
|
|
126
|
+
--picklist-values C --output-directory force-app/main/default/objects/MyCmdt__mdt
|
|
127
|
+
|
|
128
|
+
Generate a metadata file for a custom number field and specify 2 decimal places:
|
|
129
|
+
|
|
130
|
+
$ sfdx cmdt:generate:field --name MyNumberField --type Number --decimal-places 2 --output-directory \
|
|
131
|
+
force-app/main/default/objects/MyCmdt__mdt
|
|
132
|
+
|
|
133
|
+
FLAG DESCRIPTIONS
|
|
134
|
+
-d, --output-directory=<value> Directory to store newly-created field definition files.
|
|
108
135
|
|
|
109
|
-
|
|
136
|
+
New files are automatically created in the "fields" directory. The location can be an absolute path or relative to
|
|
137
|
+
the current working directory. The default is the current directory.
|
|
110
138
|
|
|
111
|
-
|
|
139
|
+
-f, --type=Checkbox|Date|DateTime|Email|Number|Percent|Phone|Picklist|Text|TextArea|LongTextArea|Url
|
|
112
140
|
|
|
113
|
-
|
|
141
|
+
Type of the field.
|
|
142
|
+
|
|
143
|
+
You can't use this command to create a custom metadata type field of type "Metadata Relationship". Use the
|
|
144
|
+
Salesforce Setup UI instead.
|
|
145
|
+
|
|
146
|
+
-s, --decimal-places=<value> Number of decimal places to use for number or percent fields.
|
|
147
|
+
|
|
148
|
+
The value must be greater than or equal to zero. Default value is 0.
|
|
114
149
|
```
|
|
115
150
|
|
|
116
|
-
_See code: [src/commands/
|
|
151
|
+
_See code: [src/commands/cmdt/generate/field.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/2.2.6/src/commands/cmdt/generate/field.ts)_
|
|
117
152
|
|
|
118
|
-
## `sfdx
|
|
153
|
+
## `sfdx cmdt:generate:fromorg`
|
|
119
154
|
|
|
120
|
-
|
|
155
|
+
Generate a custom metadata type and all its records from a Salesforce object.
|
|
121
156
|
|
|
122
157
|
```
|
|
123
158
|
USAGE
|
|
124
|
-
$ sfdx
|
|
125
|
-
|
|
126
|
-
[-l <string>] [-d <directory>] [--json] [--loglevel
|
|
127
|
-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
159
|
+
$ sfdx cmdt:generate:fromorg -o <value> -n <value> -s <value> [--json] [--api-version <value>] [-l <value>] [-p <value>]
|
|
160
|
+
[-v PackageProtected|Protected|Public] [-i] [-d <value>] [-r <value>]
|
|
128
161
|
|
|
129
162
|
FLAGS
|
|
130
|
-
-d, --
|
|
131
|
-
|
|
163
|
+
-d, --type-output-directory=<value> [default: force-app/main/default/objects] Directory to store newly-created custom
|
|
164
|
+
metadata type files.
|
|
165
|
+
-i, --ignore-unsupported Ignore unsupported field types.
|
|
166
|
+
-l, --label=<value> Label for the custom metadata type.
|
|
167
|
+
-n, --dev-name=<value> (required) Name of the custom metadata type.
|
|
168
|
+
-o, --target-org=<value> (required) Username or alias of the target org.
|
|
169
|
+
-p, --plural-label=<value> Plural version of the label value; if blank, uses label.
|
|
170
|
+
-r, --records-output-dir=<value> [default: force-app/main/default/customMetadata] Directory to store newly-created
|
|
171
|
+
custom metadata record files.
|
|
172
|
+
-s, --sobject=<value> (required) API name of the source Salesforce object used to generate the custom
|
|
173
|
+
metadata type.
|
|
174
|
+
-v, --visibility=<option> [default: Public] Who can see the custom metadata type.
|
|
175
|
+
<options: PackageProtected|Protected|Public>
|
|
176
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
177
|
+
|
|
178
|
+
GLOBAL FLAGS
|
|
179
|
+
--json Format output as json.
|
|
180
|
+
|
|
181
|
+
DESCRIPTION
|
|
182
|
+
Generate a custom metadata type and all its records from a Salesforce object.
|
|
132
183
|
|
|
133
|
-
|
|
134
|
-
|
|
184
|
+
Use this command to migrate existing custom objects or custom settings in an org to custom metadata types. If a field
|
|
185
|
+
of the Salesforce object is of an unsupported type, the field type is automatically converted to text. Run "sfdx cmdt
|
|
186
|
+
generate field --help" to see the list of supported cmdt field types, listed in the --type flag summary. Use the
|
|
187
|
+
--ignore-unsupported to ignore these fields.
|
|
135
188
|
|
|
136
|
-
|
|
137
|
-
|
|
189
|
+
This command creates the metadata files that describe the new custom metadata type and its fields in the
|
|
190
|
+
"force-app/main/default/objects/TypeName__mdt" directory by default, where "TypeName" is the value of the required
|
|
191
|
+
--dev-name flag. Use --type-output-directory to create them in a different directory.
|
|
138
192
|
|
|
139
|
-
|
|
140
|
-
|
|
193
|
+
ALIASES
|
|
194
|
+
$ sfdx force:cmdt:generate
|
|
141
195
|
|
|
142
|
-
|
|
143
|
-
|
|
196
|
+
EXAMPLES
|
|
197
|
+
Generate a custom metadata type from a custom object called MySourceObject__c in your default org:
|
|
144
198
|
|
|
145
|
-
|
|
146
|
-
number of decimal places to use for Number or Percent fields
|
|
199
|
+
$ sfdx cmdt:generate:fromorg --dev-name MyCMDT --sobject MySourceObject__c
|
|
147
200
|
|
|
148
|
-
|
|
149
|
-
|
|
201
|
+
Generate a custom metadata type from a custom object in an org with alias my-scratch-org; ignore unsupported field
|
|
202
|
+
types instead of converting them to text:
|
|
150
203
|
|
|
151
|
-
|
|
152
|
-
|
|
204
|
+
$ sfdx cmdt:generate:fromorg --dev-name MyCMDT --sobject MySourceObject__c --ignore-unsupported --target-org \
|
|
205
|
+
my-scratch-org
|
|
153
206
|
|
|
154
|
-
|
|
155
|
-
generate a custom metadata field based on the field type provided
|
|
207
|
+
Generate a protected custom metadata type from a custom object:
|
|
156
208
|
|
|
157
|
-
|
|
158
|
-
Create a metadata file for a custom checkbox field:
|
|
209
|
+
$ sfdx cmdt:generate:fromorg --dev-name MyCMDT --sobject MySourceObject__c --visibility Protected
|
|
159
210
|
|
|
160
|
-
|
|
211
|
+
Generate a protected custom metadata type from a custom setting with a specific singular and plural label:
|
|
161
212
|
|
|
162
|
-
|
|
213
|
+
$ sfdx cmdt:generate:fromorg --dev-name MyCMDT --label "My CMDT" --plural-label "My CMDTs" --sobject \
|
|
214
|
+
MySourceSetting__c --visibility Protected
|
|
163
215
|
|
|
164
|
-
|
|
216
|
+
Generate a custom metadata type and put the resulting metadata files in the specified directory:
|
|
165
217
|
|
|
166
|
-
|
|
218
|
+
$ sfdx cmdt:generate:fromorg --dev-name MyCMDT --sobject MySourceObject__c --type-output-directory \
|
|
219
|
+
path/to/my/cmdt/directory
|
|
167
220
|
|
|
168
|
-
|
|
221
|
+
Generate a custom metadata type and put the resulting record metadata file(s) in the specified directory:
|
|
222
|
+
|
|
223
|
+
$ sfdx cmdt:generate:fromorg --dev-name MyCMDT --sobject MySourceObject__c --records-output-dir \
|
|
224
|
+
path/to/my/cmdt/record/directory
|
|
225
|
+
|
|
226
|
+
FLAG DESCRIPTIONS
|
|
227
|
+
-i, --ignore-unsupported Ignore unsupported field types.
|
|
228
|
+
|
|
229
|
+
In this context, "ignore" means that the fields aren't created. The default behavior is to create fields of type
|
|
230
|
+
text and convert the field values to text.
|
|
231
|
+
|
|
232
|
+
-v, --visibility=PackageProtected|Protected|Public Who can see the custom metadata type.
|
|
233
|
+
|
|
234
|
+
For more information on what each option means, see this topic in Salesforce Help:
|
|
235
|
+
https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_ui_create.htm&type=5.
|
|
169
236
|
```
|
|
170
237
|
|
|
171
|
-
_See code: [src/commands/
|
|
238
|
+
_See code: [src/commands/cmdt/generate/fromorg.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/2.2.6/src/commands/cmdt/generate/fromorg.ts)_
|
|
172
239
|
|
|
173
|
-
## `sfdx
|
|
240
|
+
## `sfdx cmdt:generate:object`
|
|
174
241
|
|
|
175
|
-
|
|
242
|
+
Generate a new custom metadata type in the current project.
|
|
176
243
|
|
|
177
244
|
```
|
|
178
245
|
USAGE
|
|
179
|
-
$ sfdx
|
|
180
|
-
|
|
181
|
-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
246
|
+
$ sfdx cmdt:generate:object -n <value> [--json] [-l <value>] [-p <value>] [-v PackageProtected|Protected|Public] [-d
|
|
247
|
+
<value>]
|
|
182
248
|
|
|
183
249
|
FLAGS
|
|
184
|
-
-d, --
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if blank, uses label
|
|
194
|
-
-r, --recordsoutputdir=<value> [default: force-app/main/default/cus
|
|
195
|
-
tomMetadata] directory to store
|
|
196
|
-
newly-created custom metadata record
|
|
197
|
-
files
|
|
198
|
-
-s, --sobjectname=<value> (required) API name of the sObject
|
|
199
|
-
source for custom metadata
|
|
200
|
-
generation
|
|
201
|
-
-u, --targetusername=<value> username or alias for the target
|
|
202
|
-
org; overrides default target org
|
|
203
|
-
-v, --visibility=(PackageProtected|Protected|Public) [default: Public] visibility of the
|
|
204
|
-
custom metadata type
|
|
205
|
-
--apiversion=<value> override the api version used for
|
|
206
|
-
api requests made by this command
|
|
207
|
-
--json format output as json
|
|
208
|
-
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
209
|
-
this command invocation
|
|
250
|
+
-d, --output-directory=<value> Directory to store the newly-created custom metadata type files
|
|
251
|
+
-l, --label=<value> Label for the custom metadata type.
|
|
252
|
+
-n, --type-name=<value> (required) Unique object name for the custom metadata type.
|
|
253
|
+
-p, --plural-label=<value> Plural version of the label value; if blank, uses label.
|
|
254
|
+
-v, --visibility=<option> [default: Public] Who can see the custom metadata type.
|
|
255
|
+
<options: PackageProtected|Protected|Public>
|
|
256
|
+
|
|
257
|
+
GLOBAL FLAGS
|
|
258
|
+
--json Format output as json.
|
|
210
259
|
|
|
211
260
|
DESCRIPTION
|
|
212
|
-
|
|
261
|
+
Generate a new custom metadata type in the current project.
|
|
213
262
|
|
|
214
|
-
|
|
215
|
-
|
|
263
|
+
This command creates a metadata file that describes the new custom metadata type. By default, the file is created in
|
|
264
|
+
the MyCustomType__mdt directory in the current directory, where MyCustomType is the value of the required --type-name
|
|
265
|
+
flag. Use the --output-directory to generate the file in a package directory with other custom metadata types, such as
|
|
266
|
+
"force-app/main/default/objects".
|
|
216
267
|
|
|
217
|
-
|
|
268
|
+
ALIASES
|
|
269
|
+
$ sfdx force:cmdt:create
|
|
270
|
+
$ sfdx cmdt:create
|
|
218
271
|
|
|
219
|
-
|
|
272
|
+
EXAMPLES
|
|
273
|
+
Generate a custom metadata type with developer name 'MyCustomType'; this name is also used as the label:
|
|
220
274
|
|
|
221
|
-
|
|
275
|
+
$ sfdx cmdt:generate:object --type-name MyCustomType
|
|
222
276
|
|
|
223
|
-
Generate a protected custom metadata type
|
|
277
|
+
Generate a protected custom metadata type with a specific label:
|
|
224
278
|
|
|
225
|
-
|
|
279
|
+
$ sfdx cmdt:generate:object --type-name MyCustomType --label "Custom Type" --plural-label "Custom Types" \
|
|
280
|
+
--visibility Protected
|
|
226
281
|
|
|
227
|
-
|
|
282
|
+
FLAG DESCRIPTIONS
|
|
283
|
+
-d, --output-directory=<value> Directory to store the newly-created custom metadata type files
|
|
228
284
|
|
|
229
|
-
|
|
285
|
+
The location can be an absolute path or relative to the current working directory. The default is the current
|
|
286
|
+
directory.
|
|
230
287
|
|
|
231
|
-
|
|
288
|
+
-n, --type-name=<value> Unique object name for the custom metadata type.
|
|
232
289
|
|
|
233
|
-
|
|
290
|
+
The name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin
|
|
291
|
+
with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
|
|
234
292
|
|
|
235
|
-
|
|
293
|
+
-v, --visibility=PackageProtected|Protected|Public Who can see the custom metadata type.
|
|
236
294
|
|
|
237
|
-
|
|
295
|
+
For more information on what each option means, see this topic in Salesforce Help:
|
|
296
|
+
https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_ui_create.htm&type=5.
|
|
238
297
|
```
|
|
239
298
|
|
|
240
|
-
_See code: [src/commands/
|
|
299
|
+
_See code: [src/commands/cmdt/generate/object.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/2.2.6/src/commands/cmdt/generate/object.ts)_
|
|
241
300
|
|
|
242
|
-
## `sfdx
|
|
301
|
+
## `sfdx cmdt:generate:record`
|
|
243
302
|
|
|
244
|
-
|
|
303
|
+
Generate a new record for a given custom metadata type in the current project.
|
|
245
304
|
|
|
246
305
|
```
|
|
247
306
|
USAGE
|
|
248
|
-
$ sfdx
|
|
249
|
-
<directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
307
|
+
$ sfdx cmdt:generate:record -t <value> -n <value> [--json] [-l <value>] [-p true|false] [-i <value>] [-d <value>]
|
|
250
308
|
|
|
251
309
|
FLAGS
|
|
252
|
-
-d, --
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
-t, --typename=<value> (required) API name of the custom
|
|
266
|
-
metadata type to create a record for
|
|
267
|
-
--json format output as json
|
|
268
|
-
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
269
|
-
this command invocation
|
|
310
|
+
-d, --output-directory=<value> [default: force-app/main/default/customMetadata] Directory to store newly-created
|
|
311
|
+
custom metadata record files.
|
|
312
|
+
-i, --input-directory=<value> [default: force-app/main/default/objects] Directory from which to get the custom
|
|
313
|
+
metadata type definition from.
|
|
314
|
+
-l, --label=<value> Label for the new record.
|
|
315
|
+
-n, --record-name=<value> (required) Name of the new record.
|
|
316
|
+
-p, --protected=<option> [default: false] Protect the record when it's in a managed package.
|
|
317
|
+
<options: true|false>
|
|
318
|
+
-t, --type-name=<value> (required) API name of the custom metadata type to create a record for; must end in
|
|
319
|
+
"__mdt".
|
|
320
|
+
|
|
321
|
+
GLOBAL FLAGS
|
|
322
|
+
--json Format output as json.
|
|
270
323
|
|
|
271
324
|
DESCRIPTION
|
|
272
|
-
|
|
325
|
+
Generate a new record for a given custom metadata type in the current project.
|
|
326
|
+
|
|
327
|
+
The custom metadata type must already exist in your project. You must specify a name for the new record. Use
|
|
328
|
+
name=value pairs to specify the values for the fields, such as MyTextField="some text here" or MyNumberField=32.
|
|
329
|
+
|
|
330
|
+
ALIASES
|
|
331
|
+
$ sfdx force:cmdt:record:create
|
|
332
|
+
$ sfdx cmdt:record:create
|
|
273
333
|
|
|
274
334
|
EXAMPLES
|
|
275
|
-
Create a record metadata file for custom metadata type 'MyCMT' with values
|
|
335
|
+
Create a record metadata file for custom metadata type 'MyCMT' with specified values for two custom fields:
|
|
336
|
+
|
|
337
|
+
$ sfdx cmdt:generate:record --type-name MyCMT__mdt --record-name MyRecord My_Custom_Field_1=Foo \
|
|
338
|
+
My_Custom_Field_2=Bar
|
|
276
339
|
|
|
277
|
-
|
|
340
|
+
Create a protected record metadata file for custom metadata type 'MyCMT' with a specific label and values specified
|
|
341
|
+
for two custom fields:
|
|
278
342
|
|
|
279
|
-
|
|
343
|
+
$ sfdx cmdt:generate:record --type-name MyCMT__mdt --record-name MyRecord --label "My Record" --protected true \
|
|
344
|
+
My_Custom_Field_1=Foo My_Custom_Field_2=Bar
|
|
280
345
|
|
|
281
|
-
|
|
346
|
+
FLAG DESCRIPTIONS
|
|
347
|
+
-p, --protected=true|false Protect the record when it's in a managed package.
|
|
348
|
+
|
|
349
|
+
Protected records can only be accessed by code in the same managed package namespace.
|
|
282
350
|
```
|
|
283
351
|
|
|
284
|
-
_See code: [src/commands/
|
|
352
|
+
_See code: [src/commands/cmdt/generate/record.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/2.2.6/src/commands/cmdt/generate/record.ts)_
|
|
285
353
|
|
|
286
|
-
## `sfdx
|
|
354
|
+
## `sfdx cmdt:generate:records`
|
|
287
355
|
|
|
288
|
-
|
|
356
|
+
Generate new custom metadata type records from a CSV file.
|
|
289
357
|
|
|
290
358
|
```
|
|
291
359
|
USAGE
|
|
292
|
-
$ sfdx
|
|
293
|
-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
360
|
+
$ sfdx cmdt:generate:records -f <value> -t <value> [--json] [-i <value>] [-d <value>] [-n <value>]
|
|
294
361
|
|
|
295
362
|
FLAGS
|
|
296
|
-
-d, --
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
to determine the name of the record
|
|
307
|
-
-t, --typename=<value> (required) API name of the custom
|
|
308
|
-
metadata type
|
|
309
|
-
--json format output as json
|
|
310
|
-
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
311
|
-
this command invocation
|
|
363
|
+
-d, --output-directory=<value> [default: force-app/main/default/customMetadata] Directory to store newly-created
|
|
364
|
+
custom metadata record files.
|
|
365
|
+
-f, --csv=<value> (required) Pathname of the CSV file.
|
|
366
|
+
-i, --input-directory=<value> [default: force-app/main/default/objects] Directory from which to get the custom
|
|
367
|
+
metadata type definition from.
|
|
368
|
+
-n, --name-column=<value> [default: Name] Column used to determine the name of the record.
|
|
369
|
+
-t, --type-name=<value> (required) API name of the custom metadata type to create a record for.
|
|
370
|
+
|
|
371
|
+
GLOBAL FLAGS
|
|
372
|
+
--json Format output as json.
|
|
312
373
|
|
|
313
374
|
DESCRIPTION
|
|
314
|
-
|
|
375
|
+
Generate new custom metadata type records from a CSV file.
|
|
376
|
+
|
|
377
|
+
The custom metadata type must already exist in your project. By default, the Name column is used to determine the
|
|
378
|
+
record name; use the --name-column flag to specify a different column.
|
|
379
|
+
|
|
380
|
+
ALIASES
|
|
381
|
+
$ sfdx force:cmdt:record:insert
|
|
382
|
+
$ sfdx cmdt:record:insert
|
|
315
383
|
|
|
316
384
|
EXAMPLES
|
|
317
|
-
|
|
385
|
+
Generate record metadata files from values in a CSV file for the custom metadata type MyCmdt. Use 'Name' as the
|
|
386
|
+
column that specifies the record name:
|
|
387
|
+
|
|
388
|
+
$ sfdx cmdt:generate:records --csv path/to/my.csv --type-name MyCmdt
|
|
389
|
+
|
|
390
|
+
Generate record metadata files from a CSV file in the directory different from the default, and use 'PrimaryKey' as
|
|
391
|
+
the column that specifies the record name:
|
|
318
392
|
|
|
319
|
-
|
|
393
|
+
$ sfdx cmdt:generate:records --csv path/to/my.csv --type-name MyCmdt --input-directory path/to/my/cmdt/directory \
|
|
394
|
+
--name-column "PrimaryKey"
|
|
320
395
|
|
|
321
|
-
|
|
396
|
+
FLAG DESCRIPTIONS
|
|
397
|
+
-t, --type-name=<value> API name of the custom metadata type to create a record for.
|
|
322
398
|
|
|
323
|
-
|
|
399
|
+
The '__mdt' suffix is appended to the end of the name if it's omitted.
|
|
324
400
|
```
|
|
325
401
|
|
|
326
|
-
_See code: [src/commands/
|
|
402
|
+
_See code: [src/commands/cmdt/generate/records.ts](https://github.com/salesforcecli/plugin-custom-metadata/blob/2.2.6/src/commands/cmdt/generate/records.ts)_
|
|
327
403
|
|
|
328
404
|
<!-- commandsstop -->
|
|
329
405
|
|
package/oclif.lock
CHANGED
|
@@ -919,10 +919,10 @@
|
|
|
919
919
|
proper-lockfile "^4.1.2"
|
|
920
920
|
ts-retry-promise "^0.7.0"
|
|
921
921
|
|
|
922
|
-
"@salesforce/core@^5.2.0", "@salesforce/core@^5.2.1", "@salesforce/core@^5.2.10", "@salesforce/core@^5.2.5", "@salesforce/core@^5.2.6":
|
|
923
|
-
version "5.
|
|
924
|
-
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-5.
|
|
925
|
-
integrity sha512-
|
|
922
|
+
"@salesforce/core@^5.2.0", "@salesforce/core@^5.2.1", "@salesforce/core@^5.2.10", "@salesforce/core@^5.2.5", "@salesforce/core@^5.2.6", "@salesforce/core@^5.3.1":
|
|
923
|
+
version "5.3.1"
|
|
924
|
+
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-5.3.1.tgz#93c49760faa7b503bbfea8376d80a66815065e4a"
|
|
925
|
+
integrity sha512-LEQ3Yp7GxexsGXxT85Pp4AgOzzqY9Y3kol8ByVsHpHGvs8XLRbKl44IPxTXBdMB2roFM+Iosd46i0KbTuh2MQg==
|
|
926
926
|
dependencies:
|
|
927
927
|
"@salesforce/kit" "^3.0.11"
|
|
928
928
|
"@salesforce/schemas" "^1.6.0"
|
|
@@ -1109,10 +1109,10 @@
|
|
|
1109
1109
|
isomorphic-git "1.23.0"
|
|
1110
1110
|
ts-retry-promise "^0.7.0"
|
|
1111
1111
|
|
|
1112
|
-
"@salesforce/ts-sinon@^1.4.
|
|
1113
|
-
version "1.4.
|
|
1114
|
-
resolved "https://registry.yarnpkg.com/@salesforce/ts-sinon/-/ts-sinon-1.4.
|
|
1115
|
-
integrity sha512-
|
|
1112
|
+
"@salesforce/ts-sinon@^1.4.16":
|
|
1113
|
+
version "1.4.16"
|
|
1114
|
+
resolved "https://registry.yarnpkg.com/@salesforce/ts-sinon/-/ts-sinon-1.4.16.tgz#44ca058279d4009d7cc5d2de04d0ff764897f7c2"
|
|
1115
|
+
integrity sha512-nl/zQ0z+W3C5VUgOh5i7N9ZgI7cEboDGBfPk7JXIz1R3U8yjSr3IIrJgmB3XSHFRNOQ/BjxdO8XSeuOehlaX3g==
|
|
1116
1116
|
dependencies:
|
|
1117
1117
|
"@salesforce/ts-types" "^2.0.7"
|
|
1118
1118
|
sinon "^5.1.1"
|
|
@@ -1849,6 +1849,13 @@ async-lock@^1.1.0:
|
|
|
1849
1849
|
resolved "https://registry.yarnpkg.com/async-lock/-/async-lock-1.4.0.tgz#c8b6630eff68fbbdd8a5b6eb763dac3bfbb8bf02"
|
|
1850
1850
|
integrity sha512-coglx5yIWuetakm3/1dsX9hxCNox22h7+V80RQOu2XUUMidtArxKoZoOtHUPuR84SycKTXzgGzAUR5hJxujyJQ==
|
|
1851
1851
|
|
|
1852
|
+
async-retry@^1.3.3:
|
|
1853
|
+
version "1.3.3"
|
|
1854
|
+
resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280"
|
|
1855
|
+
integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==
|
|
1856
|
+
dependencies:
|
|
1857
|
+
retry "0.13.1"
|
|
1858
|
+
|
|
1852
1859
|
async@^3.2.3:
|
|
1853
1860
|
version "3.2.4"
|
|
1854
1861
|
resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c"
|
|
@@ -3099,10 +3106,10 @@ eslint-plugin-header@^3.1.1:
|
|
|
3099
3106
|
resolved "https://registry.yarnpkg.com/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz#6ce512432d57675265fac47292b50d1eff11acd6"
|
|
3100
3107
|
integrity sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==
|
|
3101
3108
|
|
|
3102
|
-
eslint-plugin-import@^2.27.5, eslint-plugin-import@^2.28.
|
|
3103
|
-
version "2.28.
|
|
3104
|
-
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.28.
|
|
3105
|
-
integrity sha512-
|
|
3109
|
+
eslint-plugin-import@^2.27.5, eslint-plugin-import@^2.28.1:
|
|
3110
|
+
version "2.28.1"
|
|
3111
|
+
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz#63b8b5b3c409bfc75ebaf8fb206b07ab435482c4"
|
|
3112
|
+
integrity sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==
|
|
3106
3113
|
dependencies:
|
|
3107
3114
|
array-includes "^3.1.6"
|
|
3108
3115
|
array.prototype.findlastindex "^1.2.2"
|
|
@@ -3113,13 +3120,12 @@ eslint-plugin-import@^2.27.5, eslint-plugin-import@^2.28.0:
|
|
|
3113
3120
|
eslint-import-resolver-node "^0.3.7"
|
|
3114
3121
|
eslint-module-utils "^2.8.0"
|
|
3115
3122
|
has "^1.0.3"
|
|
3116
|
-
is-core-module "^2.
|
|
3123
|
+
is-core-module "^2.13.0"
|
|
3117
3124
|
is-glob "^4.0.3"
|
|
3118
3125
|
minimatch "^3.1.2"
|
|
3119
3126
|
object.fromentries "^2.0.6"
|
|
3120
3127
|
object.groupby "^1.0.0"
|
|
3121
3128
|
object.values "^1.1.6"
|
|
3122
|
-
resolve "^1.22.3"
|
|
3123
3129
|
semver "^6.3.1"
|
|
3124
3130
|
tsconfig-paths "^3.14.2"
|
|
3125
3131
|
|
|
@@ -4261,10 +4267,10 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7:
|
|
|
4261
4267
|
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055"
|
|
4262
4268
|
integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==
|
|
4263
4269
|
|
|
4264
|
-
is-core-module@^2.11.0, is-core-module@^2.12.0, is-core-module@^2.
|
|
4265
|
-
version "2.
|
|
4266
|
-
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.
|
|
4267
|
-
integrity sha512-
|
|
4270
|
+
is-core-module@^2.11.0, is-core-module@^2.12.0, is-core-module@^2.13.0, is-core-module@^2.5.0:
|
|
4271
|
+
version "2.13.0"
|
|
4272
|
+
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db"
|
|
4273
|
+
integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==
|
|
4268
4274
|
dependencies:
|
|
4269
4275
|
has "^1.0.3"
|
|
4270
4276
|
|
|
@@ -5752,15 +5758,16 @@ object.values@^1.1.6:
|
|
|
5752
5758
|
define-properties "^1.1.4"
|
|
5753
5759
|
es-abstract "^1.20.4"
|
|
5754
5760
|
|
|
5755
|
-
oclif@^3.
|
|
5756
|
-
version "3.
|
|
5757
|
-
resolved "https://registry.yarnpkg.com/oclif/-/oclif-3.
|
|
5758
|
-
integrity sha512
|
|
5761
|
+
oclif@^3.17.2:
|
|
5762
|
+
version "3.17.2"
|
|
5763
|
+
resolved "https://registry.yarnpkg.com/oclif/-/oclif-3.17.2.tgz#f13756c9b1968047e76b99cb09db9725e96fb2f6"
|
|
5764
|
+
integrity sha512-+vFXxgmR7dGGz+g6YiqSZu2LXVkBMaS9/rhtsLGkYw45e53CW/3kBgPRnOvxcTDM3Td9JPeBD2JWxXnPKGQW3A==
|
|
5759
5765
|
dependencies:
|
|
5760
5766
|
"@oclif/core" "^2.11.4"
|
|
5761
5767
|
"@oclif/plugin-help" "^5.2.14"
|
|
5762
5768
|
"@oclif/plugin-not-found" "^2.3.32"
|
|
5763
5769
|
"@oclif/plugin-warn-if-update-available" "^2.0.44"
|
|
5770
|
+
async-retry "^1.3.3"
|
|
5764
5771
|
aws-sdk "^2.1231.0"
|
|
5765
5772
|
concurrently "^7.6.0"
|
|
5766
5773
|
debug "^4.3.3"
|
|
@@ -6525,7 +6532,7 @@ resolve-global@1.0.0, resolve-global@^1.0.0:
|
|
|
6525
6532
|
dependencies:
|
|
6526
6533
|
global-dirs "^0.1.1"
|
|
6527
6534
|
|
|
6528
|
-
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.22.1
|
|
6535
|
+
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.22.1:
|
|
6529
6536
|
version "1.22.3"
|
|
6530
6537
|
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.3.tgz#4b4055349ffb962600972da1fdc33c46a4eb3283"
|
|
6531
6538
|
integrity sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==
|
|
@@ -6549,6 +6556,11 @@ restore-cursor@^3.1.0:
|
|
|
6549
6556
|
onetime "^5.1.0"
|
|
6550
6557
|
signal-exit "^3.0.2"
|
|
6551
6558
|
|
|
6559
|
+
retry@0.13.1:
|
|
6560
|
+
version "0.13.1"
|
|
6561
|
+
resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658"
|
|
6562
|
+
integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==
|
|
6563
|
+
|
|
6552
6564
|
retry@^0.12.0:
|
|
6553
6565
|
version "0.12.0"
|
|
6554
6566
|
resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b"
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-custom-metadata",
|
|
3
3
|
"description": "Tools for working with custom metadata types and their records.",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.6",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
7
|
"name": "Carolyn Grabill",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"bugs": "https://github.com/salesforcecli/plugin-custom-metadata/issues",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@oclif/core": "^2.15.0",
|
|
46
|
-
"@salesforce/core": "^5.
|
|
46
|
+
"@salesforce/core": "^5.3.1",
|
|
47
47
|
"@salesforce/sf-plugins-core": "^3.1.22",
|
|
48
48
|
"@salesforce/ts-types": "^2.0.6",
|
|
49
49
|
"csv-parse": "^5.5.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@salesforce/plugin-source": "^2.10.32",
|
|
61
61
|
"@salesforce/plugin-user": "^2.3.23",
|
|
62
62
|
"@salesforce/prettier-config": "^0.0.3",
|
|
63
|
-
"@salesforce/ts-sinon": "^1.4.
|
|
63
|
+
"@salesforce/ts-sinon": "^1.4.16",
|
|
64
64
|
"@swc/core": "^1.3.37",
|
|
65
65
|
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
|
66
66
|
"@typescript-eslint/parser": "^5.62.0",
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"eslint-config-salesforce-license": "^0.2.0",
|
|
72
72
|
"eslint-config-salesforce-typescript": "^1.1.2",
|
|
73
73
|
"eslint-plugin-header": "^3.1.1",
|
|
74
|
-
"eslint-plugin-import": "^2.28.
|
|
74
|
+
"eslint-plugin-import": "^2.28.1",
|
|
75
75
|
"eslint-plugin-jsdoc": "^43.0.5",
|
|
76
76
|
"eslint-plugin-sf-plugin": "^1.16.7",
|
|
77
77
|
"husky": "^7.0.4",
|
|
78
78
|
"jsforce": "^2.0.0-beta.22",
|
|
79
79
|
"mocha": "^9.1.3",
|
|
80
80
|
"nyc": "^15.1.0",
|
|
81
|
-
"oclif": "^3.
|
|
81
|
+
"oclif": "^3.17.2",
|
|
82
82
|
"prettier": "^2.8.8",
|
|
83
83
|
"pretty-quick": "^3.1.3",
|
|
84
84
|
"shx": "0.2.2",
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
}
|
|
253
253
|
},
|
|
254
254
|
"sfdx": {
|
|
255
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-custom-metadata/2.2.
|
|
256
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-custom-metadata/2.2.
|
|
255
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-custom-metadata/2.2.6.crt",
|
|
256
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-custom-metadata/2.2.6.sig"
|
|
257
257
|
}
|
|
258
258
|
}
|