Configure product constraints and rules to ensure accurate product configuration at runtime.
Configure Revenue Settings For Constraint Models
Enable the necessary runtime configuration settings and assign permission sets to users.
Create the Constraint Model for Multisite
Use the Salesforce CLI and Python to authenticate your org and generate the Constraint Modeling Language (CML) code.
Prerequisites
- Install Salesforce CLI
- Install Python
- Download the create_cml.py script
-
Authenticate with the Salesforce org.
-
Run the following command (do not use the Lightning URL):
sf auth:web:login --instance-url https://login.salesforce.com -a tgtOrg
- Complete the browser authentication process.
-
Run the following command (do not use the Lightning URL):
-
Generate the CML code.
-
Run the following command:
python3 create_cml.py --product-class "Commodity Product Classification" --context-definition EUSalesTransactionContext
- Wait for the message CML PIPELINE COMPLETED SUCCESSFULLY!.
-
Run the following command:
Verify and Activate the Constraint Model
Review the generated constraint model for accuracy and activate the model version.
- From the App Launcher, find and select Constraint Models.
- Select the EU Product Constraint model.
- Open the constraint model in CML Editor and verify that the API Name (developerName) is correct for all attributes, such as payment method, weighted distribution, and distribution region.
-
Activate the constraint model version.
- Click the Constraint Model Versions tab.
- Click Sync.
- If prompted, click Confirm.
-
Save and activate the contraint model.
Note If you modify the default weighted distribution, you must manually update the total_weight value in the CML and resync. The total_weight value is the sum of the weighted distribution of all consumption-based child products. When introducing a new consumption-based child product, update the total_weight with its weighted distribution value and define the product within the CML following the established pattern.