@@ -120,118 +120,162 @@ sf plugins
120120
121121## ` sf generate metadata field `
122122
123- Generate local metadata for a custom field on
123+ Generate metadata source files for a new custom field on a specified object.
124124
125125```
126126USAGE
127127 $ sf generate metadata field -l <value> [-o <value>]
128128
129129FLAGS
130- -l, --label=<value> (required) The label of the field.
131- -o, --object=<value> The directory of the object folder
130+ -l, --label=<value> (required) The field's label .
131+ -o, --object=<value> The directory that contains the object's source files.
132132
133133DESCRIPTION
134- Generate local metadata for a custom field on
134+ Generate metadata source files for a new custom field on a specified object.
135135
136- Interactively generate local metadata for a custom field. This requires that the custom object you're adding the field
137- to be present locally
136+ This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the
137+ field's label with the "--label" flag. The command uses this label to provide intelligent suggestions for other field
138+ properties, such as its API name.
139+
140+ You can generate a custom field on either a standard object, such as Account, or a custom object. In both cases, the
141+ source files for the object must already exist in your local project before you run this command. If you create a
142+ relationship field, the source files for the parent object must also exist in your local directory. Use the command
143+ "sf metadata retrieve -m CustomObject:<object>" to retrieve source files for both standard and custom objects from
144+ your org. To create a custom object, run the "sf generate metadata sobject" command or use the Object Manager UI in
145+ your Salesforce org.
138146
139147EXAMPLES
140- - Create a field with a given Label (you'll be prompted to choose an object)
141- $ sf generate metadata field --label "My Field"
142- - Specify a local path to the object's folder
143- $ sf generate metadata field --label "My Field" -o force-app/main/default/objects/MyObj\_\_c
148+ Create a field with the specified label; the command prompts you for the object:
149+
150+ $ sf generate metadata field --label "My Field"
151+
152+ Specify the local path to the object's folder:
153+
154+ $ sf generate metadata field --label "My Field" --object force-app/main/default/objects/MyObject__c
144155
145156FLAG DESCRIPTIONS
146- -o, --object=<value> The directory of the object folder
157+ -o, --object=<value> The directory that contains the object's source files.
147158
148- The directory of object you're adding the field to. Include **c if the object is custom. For example,
149- `force-app/main/default/objects/MyObj**c`
159+ The object source files in your local project are grouped in a directoy with the same name as the object. Custom
160+ object names always end in "__c". An example of the object directory for the Account standard object is
161+ "force-app/main/default/objects/Account" An example custom object directory is
162+ "force-app/main/default/objects/MyObject__c"
150163
151- If not provided , the command will prompt you to choose from your local objects.
164+ If you don't specify this flag , the command prompts you to choose from your local objects.
152165```
153166
154167## ` sf generate metadata platformevent `
155168
156- Generate local metadata for a platform event
169+ Generate metadata source files for a new platform event.
157170
158171```
159172USAGE
160173 $ sf generate metadata platformevent -l <value>
161174
162175FLAGS
163- -l, --label=<value> (required) The label of the event.
176+ -l, --label=<value> (required) The platform event's label .
164177
165178DESCRIPTION
166- Generate local metadata for a platform event
179+ Generate metadata source files for a new platform event.
167180
168- Interactively generate local metadata for a platform object
181+ This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the
182+ event's label with the "--label" flag. The command uses this label to provide intelligent suggestions for other event
183+ properties, such as its API name.
169184
170185EXAMPLES
171- - Create an platform event with the given
186+ Create a platform event with the specified label:
172187
173- $ sf generate metadata platformevent --label "Platform Evt "
188+ $ sf generate metadata platformevent --label "My Platform Event "
174189```
175190
176191## ` sf generate metadata sobject `
177192
178- Generate local metadata for a custom object
193+ Generate metadata source files for a new custom object.
179194
180195```
181196USAGE
182197 $ sf generate metadata sobject -l <value> [-f]
183198
184199FLAGS
185200 -f, --use-default-features Enable all optional features without prompting.
186- -l, --label=<value> (required) The label of the object.
201+ -l, --label=<value> (required) The custom object's label .
187202
188203DESCRIPTION
189- Generate local metadata for a custom object
204+ Generate metadata source files for a new custom object.
190205
191- Interactively generate local metadata for a custom object
206+ This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the
207+ object's label with the "--label" flag. The command uses this label to provide intelligent suggestions for other
208+ object properties, such as its API name and plural label.
209+
210+ All Salesforce objects are required to have a Name field, so this command also prompts you for the label and type of
211+ the Name field. Run the "sf metadata generate field" command to create additional fields for the object.
212+
213+ To reduce the number of prompts, use the "--use-default-features" flag to automatically enable some features, such as
214+ reporting and search on the object.
192215
193216EXAMPLES
194- - Create an object with a given Label and be prompted for additional information
195- $ sf generate metadata sobject --label "My Object"
196- - Create an object and opt in to most defaults (see flag help for details)
197- $ sf generate metadata sobject --label "My Object" --use-default-features
217+ Create a custom object with the specified label and be prompted for additional information:
218+
219+ $ sf generate metadata sobject --label "My Object"
220+
221+ Create a custom object and enable optional features without prompting:
222+
223+ $ sf generate metadata sobject --label "My Object" --use-default-features
198224
199225FLAG DESCRIPTIONS
200226 -f, --use-default-features Enable all optional features without prompting.
201227
202- Enables search, feeds, reports, history, activities, bulk API, sharing, and streaming API.
228+ Enables these features:
229+
230+ * Search: Allows users to find the custom object's records when they search, including SOSL.
231+ * Feeds: Enables feed tracking.
232+ * Reports: Allows reporting of the data in the custom object records.
233+ * History: Enables object history tracking.
234+ * Activities: Allows users to associate tasks and scheduled calendar events related to the custom object records.
235+ * Bulk API: With Sharing and Streaming API, classifies the custom object as an Enterprise Application object.
236+ * Sharing: With Bulk API and Streaming API, classifies the custom object as an Enterprise Application object.
237+ * Streaming API: With Bulk API and Sharing, classifies the custom object as an Enterprise Application object.
203238```
204239
205240## ` sf generate metadata tab `
206241
207- Generate a tab for a custom object.
242+ Generate the metadata source files for a new custom tab on a custom object.
208243
209244```
210245USAGE
211246 $ sf generate metadata tab -o <value> -d <value> -i <value> [--json]
212247
213248FLAGS
214- -d, --directory=<value> (required) Path to a `tabs` folder that your new tab will be created in.
215- -i, --icon=<value> (required) An icon number from <https://lightningdesignsystem.com/icons/#custom> from 1 to
216- 100'
217- -o, --object=<value> (required) API name of the object to generate a tab for.
249+ -d, --directory=<value> (required) Path to a "tabs" directory that will contain the source files for your new tab.
250+ -i, --icon=<value> (required) Number from 1 to 100 that specifies the color scheme and icon for the custom tab.
251+ -o, --object=<value> (required) API name of the custom object you're generating a tab for.
218252
219253GLOBAL FLAGS
220254 --json Format output as json.
221255
222256DESCRIPTION
223- Generate a tab for a custom object.
257+ Generate the metadata source files for a new custom tab on a custom object.
258+
259+ Custom tabs let you display custom object data or other web content in Salesforce. Custom tabs appear in Salesforce as
260+ an item in the app’s navigation bar and in the App Launcher.
224261
225- Description of a command.
262+ This command must be run in a Salesforce DX project directory. You must pass all required information to it with the
263+ required flags. The source files for the custom object for which you're generating a tab don't need to exist in your
264+ local project.
226265
227266EXAMPLES
228- $ sf generate metadata tab -o MyObj\_\_c -i 54 -d force-app/main/default/tabs
267+ Create a tab on the MyObject__c custom object:
268+
269+ $ sf generate metadata tab --object MyObject__c --icon 54 --directory force-app/main/default/tabs
229270
230271FLAG DESCRIPTIONS
231- -o, --object=<value> API name of the object to generate a tab for.
272+ -i, --icon=<value> Number from 1 to 100 that specifies the color scheme and icon for the custom tab.
273+
274+ See https://lightningdesignsystem.com/icons/\#custom for the available icons.
275+
276+ -o, --object=<value> API name of the custom object you're generating a tab for.
232277
233- API name of the object to generate a tab for. Custom objects should end in \_\_c. The object need not be present in
234- your local source.
278+ The API name for a custom object always ends in "__c", such as "MyObject__c".
235279```
236280
237281<!-- commandsstop -->
0 commit comments