|
1 | 1 | # summary
|
2 | 2 |
|
3 |
| -delete source from your project and from a non-source-tracked org. |
| 3 | +Delete source from your project and from a non-source-tracked org. |
4 | 4 |
|
5 | 5 | # description
|
6 | 6 |
|
7 |
| -delete source from your project and from a non-source-tracked org |
8 |
| -IMPORTANT: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations. |
| 7 | +Use this command to delete components from orgs that don’t have source tracking. To remove deleted items from orgs that have source tracking enabled, "sf project deploy start". |
9 | 8 |
|
10 |
| -Use this command to delete components from orgs that don’t have source tracking. |
11 |
| -To remove deleted items from scratch orgs, which have change tracking, use "sf project deploy start". |
| 9 | +When you run this command, both the local source file and the metadata component in the org are deleted. |
12 | 10 |
|
13 | 11 | # examples
|
14 | 12 |
|
15 |
| -- $ <%= config.bin %> <%= command.id %> -m <metadata> |
| 13 | +- Delete all local Apex source files and all Apex classes from the org with alias "my-scratch": |
16 | 14 |
|
17 |
| -- $ <%= config.bin %> <%= command.id %> -p path/to/source |
| 15 | + <%= config.bin %> <%= command.id %> --metadata ApexClass --target-org my-scratch |
18 | 16 |
|
19 |
| -# flags.source-dir |
| 17 | +- Delete a specific Apex class and a Profile that has a space in it from your default org; don't prompt for confirmation: |
20 | 18 |
|
21 |
| -comma-separated list of source file paths to delete |
| 19 | + <%= config.bin %> <%= command.id %> --metadata ApexClass:MyFabulousApexClass --metadata "Profile: My Profile" --no-prompt |
22 | 20 |
|
23 |
| -# flags.metadata |
| 21 | +- Run the tests that aren’t in any managed packages as part of the deletion; if the delete succeeds, and the org has source-tracking enabled, update the source tracking information: |
24 | 22 |
|
25 |
| -comma-separated list of names of metadata components to delete |
| 23 | + <%= config.bin %> <%= command.id %> --metadata ApexClass --test-level RunLocalTests --track-source |
26 | 24 |
|
27 |
| -# flags.no-prompt |
| 25 | +- Delete the Apex source files in a directory and the corresponding components from your default org: |
28 | 26 |
|
29 |
| -do not prompt for delete confirmation |
| 27 | + <%= config.bin %> <%= command.id %> --source-dir force-app/main/default/classes |
30 | 28 |
|
31 |
| -# flags.wait |
| 29 | +- Delete all components listed in a manifest: |
32 | 30 |
|
33 |
| -wait time for command to finish in minutes |
| 31 | + <%= config.bin %> <%= command.id %> --manifest path/to/package.xml |
34 | 32 |
|
35 |
| -# flags.check-only |
| 33 | +# flags.source-dir.summary |
36 | 34 |
|
37 |
| -validate delete command but do not delete from the org or delete files locally |
| 35 | +Comma-separated list of source file paths to delete. |
38 | 36 |
|
39 |
| -# flags.test-Level |
| 37 | +# flags.metadata.summary |
40 | 38 |
|
41 |
| -deployment testing level |
| 39 | +Comma-separated list of names of metadata components to delete. |
42 | 40 |
|
43 |
| -# flags.track-source |
| 41 | +# flags.no-prompt.summary |
44 | 42 |
|
45 |
| -If the delete succeeds, update the source tracking information, similar to push |
| 43 | +Don't prompt for delete confirmation. |
46 | 44 |
|
47 |
| -# flags.force-overwrite |
| 45 | +# flags.wait.summary |
48 | 46 |
|
49 |
| -ignore conflict warnings and overwrite changes to the org |
| 47 | +Number of minutes to wait for the command to finish. |
50 | 48 |
|
51 |
| -# flags.verbose |
| 49 | +# flags.check-only.summary |
52 | 50 |
|
53 |
| -verbose output of delete result |
| 51 | +Validate delete command but don't delete anything from the org or the local project. |
54 | 52 |
|
55 |
| -# flagsLong.check-only |
| 53 | +# flags.test-Level.summary |
56 | 54 |
|
57 |
| -- Validates the deleted metadata and runs all Apex tests, but prevents the deletion from being saved to the org. |
| 55 | +Deployment Apex testing level. |
58 | 56 |
|
59 |
| -- If you change a field type from Master-Detail to Lookup or vice versa, that change isn’t supported when using the --chec-konly parameter to test a deletion (validation). This kind of change isn’t supported for test deletions to avoid the risk of data loss or corruption. If a change that isn’t supported for test deletions is included in a deletion package, the test deletion fails and issues an error. |
| 57 | +# flags.track-source.summary |
60 | 58 |
|
61 |
| -- If your deletion package changes a field type from Master-Detail to Lookup or vice versa, you can still validate the changes prior to deploying to Production by performing a full deletion to another test Sandbox. A full deletion includes a validation of the changes as part of the deletion process. |
| 59 | +If the delete succeeds, update the source tracking information. |
62 | 60 |
|
63 |
| -- Note: A Metadata API deletion that includes Master-Detail relationships deletes all detail records in the Recycle Bin in the following cases. |
| 61 | +# flags.force-overwrite.summary |
64 | 62 |
|
65 |
| -- 1. For a deletion with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before proceeding to delete the Master-Detail field, or the deletion fails. During the deletion, detail records are permanently deleted from the Recycle Bin and cannot be recovered. |
| 63 | +Ignore conflict warnings and overwrite changes to the org. |
66 | 64 |
|
67 |
| -- 2. For a deletion that converts a Lookup field relationship to a Master-Detail relationship, detail records must reference a master record or be soft-deleted (sent to the Recycle Bin) for the deletion to succeed. However, a successful deletion permanently deletes any detail records in the Recycle Bin. |
| 65 | +# flags.verbose.summary |
68 | 66 |
|
69 |
| -# flagsLong.metadata |
| 67 | +Verbose output of the delete result. |
70 | 68 |
|
71 |
| -- A comma-separated list of names of metadata components to delete from your project and your org. |
| 69 | +# flags.check-only.description |
72 | 70 |
|
73 |
| -- If you specify this parameter, don’t specify --source-dir. |
| 71 | +IMPORTANT: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations. |
74 | 72 |
|
75 |
| -# flagsLong.source-dir |
| 73 | +Validates the deleted metadata and runs all Apex tests, but prevents the deletion from being saved to the org. |
76 | 74 |
|
77 |
| -- A comma-separated list of paths to the local metadata to delete. The supplied paths can be a single file (in which case the operation is applied to only one file) or a folder (in which case the operation is applied to all metadata types in the directory and its sub-directories). |
| 75 | +If you change a field type from Master-Detail to Lookup or vice versa, that change isn’t supported when using the --chec-konly parameter to test a deletion (validation). This kind of change isn’t supported for test deletions to avoid the risk of data loss or corruption. If a change that isn’t supported for test deletions is included in a deletion package, the test deletion fails and issues an error. |
78 | 76 |
|
79 |
| -- If you specify this parameter, don’t specify --metadata. |
| 77 | +If your deletion package changes a field type from Master-Detail to Lookup or vice versa, you can still validate the changes prior to deploying to Production by performing a full deletion to another test Sandbox. A full deletion includes a validation of the changes as part of the deletion process. |
80 | 78 |
|
81 |
| -# flagsLong.wait |
| 79 | +Note: A Metadata API deletion that includes Master-Detail relationships deletes all detail records in the Recycle Bin in the following cases. |
82 | 80 |
|
83 |
| -Number of minutes to wait for the command to complete and display results to the terminal window. If the command continues to run after the wait period, the CLI returns control of the terminal window to you. |
| 81 | + 1. For a deletion with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before proceeding to delete the Master-Detail field, or the deletion fails. During the deletion, detail records are permanently deleted from the Recycle Bin and cannot be recovered. |
84 | 82 |
|
85 |
| -# flagsLong.test-Level |
| 83 | + 2. For a deletion that converts a Lookup field relationship to a Master-Detail relationship, detail records must reference a master record or be soft-deleted (sent to the Recycle Bin) for the deletion to succeed. However, a successful deletion permanently deletes any detail records in the Recycle Bin. |
86 | 84 |
|
87 |
| -- Specifies which level of deployment tests to run. Valid values are: |
| 85 | +# flags.metadata.description |
88 | 86 |
|
89 |
| -- NoTestRu — No tests are run. This test level applies only to deployments to development environments, such as sandbox, Developer Edition, or trial orgs. This test level is the default for development environments. |
| 87 | +If you specify this parameter, don’t specify --source-dir. |
90 | 88 |
|
91 |
| -- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked packages. This test level is the default for production deployments that include Apex classes or triggers. |
| 89 | +# flags.source-dir.description |
| 90 | + |
| 91 | +The supplied paths can be a single file (in which case the operation is applied to only one file) or a folder (in which case the operation is applied to all metadata types in the directory and its sub-directories). |
| 92 | + |
| 93 | +If you specify this parameter, don’t specify --metadata. |
92 | 94 |
|
| 95 | +# flags.wait.description |
| 96 | + |
| 97 | +If the command continues to run after the wait period, the CLI returns control of the terminal window to you. |
| 98 | + |
| 99 | +# flags.test-Level.description |
| 100 | + |
| 101 | +Valid values are: |
| 102 | + |
| 103 | +- NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as sandbox, Developer Edition, or trial orgs. This test level is the default for development environments. |
| 104 | +- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked packages. This test level is the default for production deployments that include Apex classes or triggers. |
93 | 105 | - RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
|
94 | 106 |
|
95 |
| -- If you don’t specify a test level, the default behavior depends on the contents of your deployment package. For more information, see “Running Tests in a Deployment” in the Metadata API Developer Guide. |
| 107 | +If you don’t specify a test level, the default behavior depends on the contents of your deployment package. For more information, see “Running Tests in a Deployment” in the Metadata API Developer Guide. |
96 | 108 |
|
97 | 109 | # localPrompt
|
98 | 110 |
|
|
0 commit comments