@salesforce/plugin-templates 56.7.2 → 56.8.1

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 CHANGED
@@ -122,6 +122,7 @@ Congrats, you are debugging!
122
122
  - [`sf template generate apex class`](#sf-template-generate-apex-class)
123
123
  - [`sf template generate apex trigger`](#sf-template-generate-apex-trigger)
124
124
  - [`sf template generate digital-experience site`](#sf-template-generate-digital-experience-site)
125
+ - [`sf template generate flexipage`](#sf-template-generate-flexipage)
125
126
  - [`sf template generate lightning app`](#sf-template-generate-lightning-app)
126
127
  - [`sf template generate lightning component`](#sf-template-generate-lightning-component)
127
128
  - [`sf template generate lightning event`](#sf-template-generate-lightning-event)
@@ -174,7 +175,7 @@ FLAG DESCRIPTIONS
174
175
  directory.
175
176
  ```
176
177
 
177
- _See code: [src/commands/template/generate/analytics/template.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/analytics/template.ts)_
178
+ _See code: [src/commands/template/generate/analytics/template.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/analytics/template.ts)_
178
179
 
179
180
  ## `sf template generate apex class`
180
181
 
@@ -234,7 +235,7 @@ FLAG DESCRIPTIONS
234
235
  Supplied parameter values or default values are filled into a copy of the template.
235
236
  ```
236
237
 
237
- _See code: [src/commands/template/generate/apex/class.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/apex/class.ts)_
238
+ _See code: [src/commands/template/generate/apex/class.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/apex/class.ts)_
238
239
 
239
240
  ## `sf template generate apex trigger`
240
241
 
@@ -304,7 +305,7 @@ FLAG DESCRIPTIONS
304
305
  Supplied parameter values or default values are filled into a copy of the template.
305
306
  ```
306
307
 
307
- _See code: [src/commands/template/generate/apex/trigger.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/apex/trigger.ts)_
308
+ _See code: [src/commands/template/generate/apex/trigger.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/apex/trigger.ts)_
308
309
 
309
310
  ## `sf template generate digital-experience site`
310
311
 
@@ -354,7 +355,89 @@ FLAG DESCRIPTIONS
354
355
  project, defaults to the current directory.
355
356
  ```
356
357
 
357
- _See code: [src/commands/template/generate/digital-experience/site.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/digital-experience/site.ts)_
358
+ _See code: [src/commands/template/generate/digital-experience/site.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/digital-experience/site.ts)_
359
+
360
+ ## `sf template generate flexipage`
361
+
362
+ Generate a FlexiPage, also known as a Lightning page.
363
+
364
+ ```
365
+ USAGE
366
+ $ sf template generate flexipage -n <value> -t RecordPage|AppPage|HomePage [--json] [--flags-dir <value>] [-d <value>]
367
+ [--api-version <value>] [--label <value>] [--description <value>] [-s <value>] [--primary-field <value>]
368
+ [--secondary-fields <value>...] [--detail-fields <value>...]
369
+
370
+ FLAGS
371
+ -d, --output-dir=<value> [default: .] Directory for saving the created files.
372
+ -n, --name=<value> (required) Name of the FlexiPage.
373
+ -s, --sobject=<value> API name of the Salesforce object; required when creating a RecordPage.
374
+ -t, --template=<option> (required) Template type for the FlexiPage.
375
+ <options: RecordPage|AppPage|HomePage>
376
+ --api-version=<value> Override the api version used for api requests made by this command
377
+ --description=<value> Description for the FlexiPage, which provides context about its purpose.
378
+ --detail-fields=<value>... Fields to display in the Details tab. Specify multiple fields separated by commas.
379
+ Fields are split into two columns. Used only with RecordPage.
380
+ --label=<value> Label of this FlexiPage; if not specified, uses the FlexiPage name as the label.
381
+ --primary-field=<value> Primary field for the dynamic highlights header; typically 'Name'. Used only with
382
+ RecordPage.
383
+ --secondary-fields=<value>... Secondary fields shown in the dynamic highlights header. Specify multiple fields
384
+ separated by commas. Maximum of 11 fields. Used only with RecordPage.
385
+
386
+ GLOBAL FLAGS
387
+ --flags-dir=<value> Import flag values from a directory.
388
+ --json Format output as json.
389
+
390
+ DESCRIPTION
391
+ Generate a FlexiPage, also known as a Lightning page.
392
+
393
+ FlexiPages are the metadata types associated with a Lightning page. A Lightning page represents a customizable screen
394
+ made up of regions containing Lightning components.
395
+
396
+ You can use this command to generate these types of FlexiPages; specify the type with the --template flag:
397
+
398
+ - AppPage: A Lightning page used as the home page for a custom app or a standalone application page.
399
+ - HomePage: A Lightning page used to override the Home page in Lightning Experience.
400
+ - RecordPage: A Lightning page used to override an object record page in Lightning Experience. Requires that you
401
+ specify the object name with the --sobject flag.
402
+
403
+ EXAMPLES
404
+ Generate a RecordPage FlexiPage for the Account object in the current directory:
405
+
406
+ $ sf template generate flexipage --name Account_Record_Page --template RecordPage --sobject Account
407
+
408
+ Generate an AppPage FlexiPage in the "force-app/main/default/flexipages" directory:
409
+
410
+ $ sf template generate flexipage --name Sales_Dashboard --template AppPage --output-dir \
411
+ force-app/main/default/flexipages
412
+
413
+ Generate a HomePage FlexiPage with a custom label:
414
+
415
+ $ sf template generate flexipage --name Custom_Home --template HomePage --label "Sales Home Page"
416
+
417
+ Generate a RecordPage with dynamic highlights and detail fields:
418
+
419
+ $ sf template generate flexipage --name Property_Page --template RecordPage --sobject Rental_Property__c \
420
+ --primary-field Name --secondary-fields Property_Address__c,City__c --detail-fields \
421
+ Name,Property_Address__c,City__c,Monthly_Rent__c,Bedrooms__c
422
+
423
+ FLAG DESCRIPTIONS
424
+ -d, --output-dir=<value> Directory for saving the created files.
425
+
426
+ The location can be an absolute path or relative to the current working directory. The default is the current
427
+ directory.
428
+
429
+ -n, --name=<value> Name of the FlexiPage.
430
+
431
+ The name can contain only alphanumeric characters, must start with a letter, and can't end with an underscore or
432
+ contain two consecutive underscores.
433
+
434
+ -s, --sobject=<value> API name of the Salesforce object; required when creating a RecordPage.
435
+
436
+ For RecordPage FlexiPages, you must specify the associated object API name, such as 'Account', 'Opportunity', or
437
+ 'Custom_Object__c'. This sets the `sobjectType` field in the FlexiPage metadata.
438
+ ```
439
+
440
+ _See code: [src/commands/template/generate/flexipage/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/flexipage/index.ts)_
358
441
 
359
442
  ## `sf template generate lightning app`
360
443
 
@@ -410,7 +493,7 @@ FLAG DESCRIPTIONS
410
493
  Supplied parameter values or default values are filled into a copy of the template.
411
494
  ```
412
495
 
413
- _See code: [src/commands/template/generate/lightning/app.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/lightning/app.ts)_
496
+ _See code: [src/commands/template/generate/lightning/app.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/lightning/app.ts)_
414
497
 
415
498
  ## `sf template generate lightning component`
416
499
 
@@ -480,7 +563,7 @@ FLAG DESCRIPTIONS
480
563
  Supplied parameter values or default values are filled into a copy of the template.
481
564
  ```
482
565
 
483
- _See code: [src/commands/template/generate/lightning/component.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/lightning/component.ts)_
566
+ _See code: [src/commands/template/generate/lightning/component.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/lightning/component.ts)_
484
567
 
485
568
  ## `sf template generate lightning event`
486
569
 
@@ -536,7 +619,7 @@ FLAG DESCRIPTIONS
536
619
  Supplied parameter values or default values are filled into a copy of the template.
537
620
  ```
538
621
 
539
- _See code: [src/commands/template/generate/lightning/event.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/lightning/event.ts)_
622
+ _See code: [src/commands/template/generate/lightning/event.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/lightning/event.ts)_
540
623
 
541
624
  ## `sf template generate lightning interface`
542
625
 
@@ -592,7 +675,7 @@ FLAG DESCRIPTIONS
592
675
  Supplied parameter values or default values are filled into a copy of the template.
593
676
  ```
594
677
 
595
- _See code: [src/commands/template/generate/lightning/interface.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/lightning/interface.ts)_
678
+ _See code: [src/commands/template/generate/lightning/interface.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/lightning/interface.ts)_
596
679
 
597
680
  ## `sf template generate lightning test`
598
681
 
@@ -648,7 +731,7 @@ FLAG DESCRIPTIONS
648
731
  Supplied parameter values or default values are filled into a copy of the template.
649
732
  ```
650
733
 
651
- _See code: [src/commands/template/generate/lightning/test.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/lightning/test.ts)_
734
+ _See code: [src/commands/template/generate/lightning/test.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/lightning/test.ts)_
652
735
 
653
736
  ## `sf template generate project`
654
737
 
@@ -754,7 +837,7 @@ FLAG DESCRIPTIONS
754
837
  Override the api version used for api requests made by this command
755
838
  ```
756
839
 
757
- _See code: [src/commands/template/generate/project/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/project/index.ts)_
840
+ _See code: [src/commands/template/generate/project/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/project/index.ts)_
758
841
 
759
842
  ## `sf template generate static-resource`
760
843
 
@@ -817,7 +900,7 @@ FLAG DESCRIPTIONS
817
900
  etc.
818
901
  ```
819
902
 
820
- _See code: [src/commands/template/generate/static-resource/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/static-resource/index.ts)_
903
+ _See code: [src/commands/template/generate/static-resource/index.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/static-resource/index.ts)_
821
904
 
822
905
  ## `sf template generate visualforce component`
823
906
 
@@ -874,7 +957,7 @@ FLAG DESCRIPTIONS
874
957
  Supplied parameter values or default values are filled into a copy of the template.
875
958
  ```
876
959
 
877
- _See code: [src/commands/template/generate/visualforce/component.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/visualforce/component.ts)_
960
+ _See code: [src/commands/template/generate/visualforce/component.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/visualforce/component.ts)_
878
961
 
879
962
  ## `sf template generate visualforce page`
880
963
 
@@ -925,6 +1008,6 @@ FLAG DESCRIPTIONS
925
1008
  The name can be up to 40 characters and must start with a letter.
926
1009
  ```
927
1010
 
928
- _See code: [src/commands/template/generate/visualforce/page.ts](https://github.com/salesforcecli/plugin-templates/blob/56.7.2/src/commands/template/generate/visualforce/page.ts)_
1011
+ _See code: [src/commands/template/generate/visualforce/page.ts](https://github.com/salesforcecli/plugin-templates/blob/56.8.1/src/commands/template/generate/visualforce/page.ts)_
929
1012
 
930
1013
  <!-- commandsstop -->
@@ -0,0 +1,24 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { CreateOutput } from '@salesforce/templates';
3
+ export default class FlexipageGenerate extends SfCommand<CreateOutput> {
4
+ static readonly summary: string;
5
+ static readonly description: string;
6
+ static readonly examples: string[];
7
+ static readonly state = "beta";
8
+ static readonly flags: {
9
+ name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ template: import("@oclif/core/interfaces").OptionFlag<"RecordPage" | "AppPage" | "HomePage", import("@oclif/core/interfaces").CustomOptions>;
11
+ 'output-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ label: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ sobject: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'primary-field': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'secondary-fields': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'detail-fields': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ internal: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
+ loglevel: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ };
22
+ private static readonly MAX_SECONDARY_FIELDS;
23
+ run(): Promise<CreateOutput>;
24
+ }
@@ -0,0 +1,113 @@
1
+ /*
2
+ * Copyright (c) 2019, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
8
+ import { TemplateType } from '@salesforce/templates';
9
+ import { Messages } from '@salesforce/core';
10
+ import { getCustomTemplates, runGenerator } from '../../../../utils/templateCommand.js';
11
+ import { internalFlag, outputDirFlag } from '../../../../utils/flags.js';
12
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
13
+ const messages = Messages.loadMessages('@salesforce/plugin-templates', 'flexipage');
14
+ export default class FlexipageGenerate extends SfCommand {
15
+ static summary = messages.getMessage('summary');
16
+ static description = messages.getMessage('description');
17
+ static examples = messages.getMessages('examples');
18
+ static state = 'beta';
19
+ static flags = {
20
+ name: Flags.string({
21
+ char: 'n',
22
+ summary: messages.getMessage('flags.name.summary'),
23
+ description: messages.getMessage('flags.name.description'),
24
+ required: true,
25
+ aliases: ['flexipagename'],
26
+ deprecateAliases: true,
27
+ }),
28
+ template: Flags.option({
29
+ char: 't',
30
+ summary: messages.getMessage('flags.template.summary'),
31
+ required: true,
32
+ options: ['RecordPage', 'AppPage', 'HomePage'],
33
+ })(),
34
+ 'output-dir': outputDirFlag,
35
+ 'api-version': orgApiVersionFlagWithDeprecations,
36
+ label: Flags.string({
37
+ summary: messages.getMessage('flags.label.summary'),
38
+ aliases: ['masterlabel'],
39
+ deprecateAliases: true,
40
+ }),
41
+ description: Flags.string({
42
+ summary: messages.getMessage('flags.description.summary'),
43
+ }),
44
+ sobject: Flags.string({
45
+ char: 's',
46
+ summary: messages.getMessage('flags.sobject.summary'),
47
+ description: messages.getMessage('flags.sobject.description'),
48
+ aliases: ['entity-name', 'entity'],
49
+ deprecateAliases: true,
50
+ }),
51
+ 'primary-field': Flags.string({
52
+ summary: messages.getMessage('flags.primary-field.summary'),
53
+ }),
54
+ 'secondary-fields': Flags.string({
55
+ summary: messages.getMessage('flags.secondary-fields.summary'),
56
+ multiple: true,
57
+ delimiter: ',',
58
+ }),
59
+ 'detail-fields': Flags.string({
60
+ summary: messages.getMessage('flags.detail-fields.summary'),
61
+ multiple: true,
62
+ delimiter: ',',
63
+ }),
64
+ internal: internalFlag,
65
+ loglevel,
66
+ };
67
+ static MAX_SECONDARY_FIELDS = 11;
68
+ async run() {
69
+ const { flags } = await this.parse(FlexipageGenerate);
70
+ // Validate RecordPage requires sobject
71
+ if (flags.template === 'RecordPage' && !flags.sobject) {
72
+ throw new Error(messages.getMessage('errors.recordPageRequiresSobject'));
73
+ }
74
+ // Validate RecordPage-specific flags are only used with RecordPage template
75
+ const recordPageOnlyFlags = ['primary-field', 'secondary-fields', 'detail-fields'];
76
+ if (flags.template !== 'RecordPage') {
77
+ for (const flagName of recordPageOnlyFlags) {
78
+ if (flags[flagName]) {
79
+ throw new Error(messages.getMessage('errors.flagRequiresRecordPage', [flagName]));
80
+ }
81
+ }
82
+ }
83
+ // Validate secondary fields limit (Dynamic Highlights Panel supports max 11)
84
+ const secondaryFieldsCount = flags['secondary-fields']?.length ?? 0;
85
+ if (secondaryFieldsCount > FlexipageGenerate.MAX_SECONDARY_FIELDS) {
86
+ throw new Error(messages.getMessage('errors.tooManySecondaryFields', [
87
+ secondaryFieldsCount.toString(),
88
+ FlexipageGenerate.MAX_SECONDARY_FIELDS.toString(),
89
+ ]));
90
+ }
91
+ // Convert CLI flags to library options
92
+ const flagsAsOptions = {
93
+ flexipagename: flags.name,
94
+ template: flags.template,
95
+ outputdir: flags['output-dir'],
96
+ apiversion: flags['api-version'],
97
+ masterlabel: flags.label,
98
+ description: flags.description,
99
+ entityName: flags.sobject,
100
+ primaryField: flags['primary-field'],
101
+ secondaryFields: flags['secondary-fields'] ?? [],
102
+ detailFields: flags['detail-fields'] ?? [],
103
+ internal: flags.internal,
104
+ };
105
+ return runGenerator({
106
+ templateType: TemplateType.Flexipage,
107
+ opts: flagsAsOptions,
108
+ ux: new Ux({ jsonEnabled: this.jsonEnabled() }),
109
+ templates: getCustomTemplates(this.configAggregator),
110
+ });
111
+ }
112
+ }
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/template/generate/flexipage/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,iCAAiC,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAChH,OAAO,EAAkC,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEzE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,8BAA8B,EAAE,WAAW,CAAC,CAAC;AAEpF,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAuB;IAC7D,MAAM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,IAAI,CAAC,gBAAgB,CAAC;SACrD,CAAC,CAAC;IACL,CAAC"}
@@ -12,7 +12,7 @@ Creates an Experience Cloud site with the specified template, name, and URL path
12
12
 
13
13
  <%= config.bin %> <%= command.id %> --template BuildYourOwnLWR --name mysite --url-path-prefix mysite
14
14
 
15
- - Generate an Experience Cloud site like the last example, but generate the files into the specified output directory:
15
+ - Generate an Experience Cloud site like the last example, but generate the files into the specified output directory:
16
16
 
17
17
  <%= config.bin %> <%= command.id %> --template BuildYourOwnLWR --name mysite --url-path-prefix mysite --output-dir force-app/main/default
18
18
 
@@ -28,7 +28,7 @@ Template to use when generating the site.
28
28
 
29
29
  Supported templates:
30
30
 
31
- - BuildYourOwnLWR - Creates blazing-fast digital experiences, such as websites, microsites, and portals, using the Lightning Web Components programming model. Powered by Lightning Web Runtime (LWR), this customizable template delivers unparalleled site performance. For additional details, see this Salesforce Help topic: https://help.salesforce.com/s/articleView?id=experience.rss_build_your_own_lwr.htm.
31
+ - BuildYourOwnLWR - Creates blazing-fast digital experiences, such as websites, microsites, and portals, using the Lightning Web Components programming model. Powered by Lightning Web Runtime (LWR), this customizable template delivers unparalleled site performance. For additional details, see this Salesforce Help topic: https://help.salesforce.com/s/articleView?id=experience.rss_build_your_own_lwr.htm.
32
32
 
33
33
  # flags.url-path-prefix.summary
34
34
 
@@ -0,0 +1,83 @@
1
+ # examples
2
+
3
+ - Generate a RecordPage FlexiPage for the Account object in the current directory:
4
+
5
+ <%= config.bin %> <%= command.id %> --name Account_Record_Page --template RecordPage --sobject Account
6
+
7
+ - Generate an AppPage FlexiPage in the "force-app/main/default/flexipages" directory:
8
+
9
+ <%= config.bin %> <%= command.id %> --name Sales_Dashboard --template AppPage --output-dir force-app/main/default/flexipages
10
+
11
+ - Generate a HomePage FlexiPage with a custom label:
12
+
13
+ <%= config.bin %> <%= command.id %> --name Custom_Home --template HomePage --label "Sales Home Page"
14
+
15
+ - Generate a RecordPage with dynamic highlights and detail fields:
16
+
17
+ <%= config.bin %> <%= command.id %> --name Property_Page --template RecordPage --sobject Rental_Property__c --primary-field Name --secondary-fields Property_Address__c,City__c --detail-fields Name,Property_Address__c,City__c,Monthly_Rent__c,Bedrooms__c
18
+
19
+ # summary
20
+
21
+ Generate a FlexiPage, also known as a Lightning page.
22
+
23
+ # description
24
+
25
+ FlexiPages are the metadata types associated with a Lightning page. A Lightning page represents a customizable screen made up of regions containing Lightning components.
26
+
27
+ You can use this command to generate these types of FlexiPages; specify the type with the --template flag:
28
+
29
+ - AppPage: A Lightning page used as the home page for a custom app or a standalone application page.
30
+ - HomePage: A Lightning page used to override the Home page in Lightning Experience.
31
+ - RecordPage: A Lightning page used to override an object record page in Lightning Experience. Requires that you specify the object name with the --sobject flag.
32
+
33
+ # flags.name.summary
34
+
35
+ Name of the FlexiPage.
36
+
37
+ # flags.name.description
38
+
39
+ The name can contain only alphanumeric characters, must start with a letter, and can't end with an underscore or contain two consecutive underscores.
40
+
41
+ # flags.template.summary
42
+
43
+ Template type for the FlexiPage.
44
+
45
+ # flags.label.summary
46
+
47
+ Label of this FlexiPage; if not specified, uses the FlexiPage name as the label.
48
+
49
+ # flags.description.summary
50
+
51
+ Description for the FlexiPage, which provides context about its purpose.
52
+
53
+ # flags.sobject.summary
54
+
55
+ API name of the Salesforce object; required when creating a RecordPage.
56
+
57
+ # flags.sobject.description
58
+
59
+ For RecordPage FlexiPages, you must specify the associated object API name, such as 'Account', 'Opportunity', or 'Custom_Object__c'. This sets the `sobjectType` field in the FlexiPage metadata.
60
+
61
+ # flags.primary-field.summary
62
+
63
+ Primary field for the dynamic highlights header; typically 'Name'. Used only with RecordPage.
64
+
65
+ # flags.secondary-fields.summary
66
+
67
+ Secondary fields shown in the dynamic highlights header. Specify multiple fields separated by commas. Maximum of 11 fields. Used only with RecordPage.
68
+
69
+ # flags.detail-fields.summary
70
+
71
+ Fields to display in the Details tab. Specify multiple fields separated by commas. Fields are split into two columns. Used only with RecordPage.
72
+
73
+ # errors.recordPageRequiresSobject
74
+
75
+ RecordPage template requires the --sobject flag to specify the Salesforce object API name (e.g., 'Account', 'Opportunity', 'Custom_Object__c').
76
+
77
+ # errors.tooManySecondaryFields
78
+
79
+ Too many secondary fields specified (%s). The Dynamic Highlights Panel supports a maximum of %s secondary fields.
80
+
81
+ # errors.flagRequiresRecordPage
82
+
83
+ The --%s flag can only be used with --template RecordPage.
@@ -50,4 +50,12 @@ Directory for saving the created files.
50
50
 
51
51
  # flags.output-dir.description
52
52
 
53
- The location can be an absolute path or relative to the current working directory. If not specified, the command reads your sfdx-project.json and defaults to the webapplications directory within your default package directory. When running outside a Salesforce DX project, defaults to the current directory.
53
+ The location can be an absolute path or relative to the current working directory.
54
+
55
+ **Important:** The generator automatically ensures the output directory ends with "webapplications". If your specified path doesn't end with "webapplications", it's automatically appended. The web application is created at "<output-dir>/<webappname>".
56
+
57
+ **Examples:**
58
+ - "--output-dir force-app/main/default" → Creates a web application at "force-app/main/default/webapplications/MyWebApp/"
59
+ - "--output-dir force-app/main/default/webapplications" → Creates a web application at "force-app/main/default/webapplications/MyWebApp/" (no change)
60
+
61
+ If not specified, the command reads your sfdx-project.json and defaults to "webapplications" directory within your default package directory. When running outside a Salesforce DX project, defaults to the current directory.