Configure the Constraint Model for Multisite

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.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions
User Permissions Needed
To create user profiles and users: Energy & Utilities Cloud Features
  1. From the App Launcher, find and select Revenue Settings.
  2. Enable Configure Products at Runtime.
  3. Enable Set Up Configuration Rules and Constraints with Constraints Engine.
  4. Assign the Product Configurator permission set to all users, including admins and standard 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

  1. Authenticate with the Salesforce org.
    1. Run the following command (do not use the Lightning URL):
      sf auth:web:login --instance-url https://login.salesforce.com -a tgtOrg
    2. Complete the browser authentication process.
  2. Generate the CML code.
    1. Run the following command:
      python3 create_cml.py --product-class "Commodity Product Classification" --context-definition EUSalesTransactionContext
    2. Wait for the message CML PIPELINE COMPLETED SUCCESSFULLY!.

Verify and Activate the Constraint Model

Review the generated constraint model for accuracy and activate the model version.

  1. From the App Launcher, find and select Constraint Models.
  2. Select the EU Product Constraint model.
  3. 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.
  4. Activate the constraint model version.
    1. Click the Constraint Model Versions tab.
    2. Click Sync.
    3. If prompted, click Confirm.
    4. Save and activate the contraint model.
      Note
      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.