Enable a behavior of your project source files, and then update your Salesforce DX project to implement the behavior.
note: This feature is a Beta Service. Customers may opt to try such Beta Service in its sole discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms.
Description for project convert source-behavior
Specifically, this command updates the "sourceBehaviorOption" option in the "sfdx-project.json" file and then converts the associated local source files in your project as needed.
For example, run this command with the "--behavior decomposePermissionSetBeta" flag to start decomposing permission sets when you deploy or retrieve them. Decomposing means breaking up the monolithic metadata API format XML file that corresponds to a metadata component into smaller XML files and directories based on its subtypes. Permission sets are not decomposed by default; you must opt-in to start decomposing them by using this command. When the command finishes, your "sfdx-project.json" file is updated to always decompose permission sets, and the existing permission set files in your local package directories are converted into the new decomposed format. You run this command only once for a given behavior change.
For more information about the possible values for the --behavior flag, see the "sourceBehaviorOptions" section in the https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm topic.
Flags
| Flag Name (Long) | Flag Name (Short) | Description |
|---|---|---|
| <code>‑‑behavior</code> | <code>‑b</code> | Type: Value<br>Required<br>Valid Values: decomposeCustomLabelsBeta2, decomposeCustomLabelsBeta, decomposePermissionSetBeta, decomposePermissionSetBeta2, decomposeSharingRulesBeta, decomposeWorkflowBeta, decomposeExternalServiceRegistrationBeta<br><br>Behavior to enable; the values correspond to the possible values of the "sourceBehaviorOption" option in the "sfdx-project.json" file. |
| <code>‑‑dry‑run</code> | N/A | Type: Boolean<br><br>Display what the command would do, but don't make any actual changes. |
| <code>‑‑flags‑dir</code> | N/A | Type: Value<br><br>Import flag values from a directory. |
| <code>‑‑json</code> | N/A | Type: Boolean<br><br>Format output as json. |
| <code>‑‑preserve‑temp‑dir</code> | N/A | Type: Boolean<br><br>Don't delete the metadata API format temporary directory that this command creates. Useful for debugging. |
| <code>‑‑target‑org</code> | <code>‑o</code> | Type: Value<br><br>Username or alias of the target org. |
Examples for project convert source-behavior
Update your Salesforce DX project to decompose custom permission sets:
sf project convert source-behavior --behavior decomposePermissionSetBeta
Display what the command would do, but don't change any existing files:
sf project convert source-behavior --behavior decomposePermissionSetBeta --dry-run
Keep the temporary directory that contains the interim metadata API formatted files:
sf project convert source-behavior --behavior decomposePermissionSetBeta --dry-run --preserve-temp-dir
<!-- prettier-ignore-end -->