Christmas & New Year Special – Get 50% OFF on FileTranz

Claim Your Offer

Quote Field Driven Attribute Control in Revenue Cloud

Automatically control product attributes in Revenue Cloud using Quotelevel fields with the Constraint Rule Engine for smarter, error free configurations

By Kishore Selvakumar
Salesforce Developer

Quote Field Driven Attribute Control in Revenue Cloud

Introduction

Modern B2B sales demand more than just selecting products, they require intelligent configurations that automatically adapt to business context, such as Channel Partner Tiers and commercial agreements. Revenue Cloud's Constraint Rules Engine enables this by allowing Quote-level data to directly influence how products are configured in real time. In this blog, we explore a complete, real-world implementation of Quote field-driven attribute control, demonstrating how product attributes can dynamically change based on the Channel Partner Tier selected on a Quote. Using a practical Laptop Pro Bundle scenario, you'll learn how to enable and troubleshoot the Constraint Engine, expose Quote fields through context definitions, build constraint models using CML, and validate the behavior through hands-on testing, ensuring your product configurations remain accurate, consistent, and aligned with your business rules.

What is Constraint Rules Engine

Constraint Rules Engine in Salesforce Revenue Cloud is an advanced product configuration engine that allows administrators and product managers to define and enforce complex product configuration rules, dependencies, validations, and constraints without extensive custom code. It helps ensure customers and sales reps can configure only valid product combinations.

Set up Constraint Rules Engine

If you haven't configured the Constraint Rules Engine in your org, please follow the steps to create your constraint rule in Revenue Cloud. If you have already configured the Constraint Rules Engine, you can skip this step and proceed directly to the "Control Product Attributes Based on the Quote Field" section.

Assign Permissions

Assign the permission set to the user to design your new constraint rule

Permission set:- Product Configuration Constraints Designer

Enable Constraints Engine from Revenue Settings

Follow the steps below to enable the Constraint Rules Engine in Revenue Cloud.

  1. Go to Setup and search for Revenue Settings in the Quick Find box
  2. On Revenue Settings, search for "Set Up Configuration Rules and Constraints with Constraints Engine" and click on the toggle to enable the settings.
Fix: Product Configurator Error After Enabling Constraint Rules Engine
Error Message:

After enabling the Constraint Rules Engine, you may see the following error when configuring products:

Something went wrong while running configuration rules.
You can't open the Product Configurator because the ConstraintEngineNodeStatus field either hasn't been added to transaction line item objects or hasn't been mapped to the active context definition.

This error occurs when the ConstraintEngineNodeStatus field is missing or not properly mapped in the SalesTransactionContext.

The ConstraintEngineNodeStatus field acts like a status tracker for every product option being evaluated. It stores the results returned by the Constraint Rules Engine and helps the Product Configurator understand how each product component should behave.

When the Product Configurator launches, it expects the ConstraintEngineNodeStatus field to be available through the active SalesTransactionContext. If the field is missing or not mapped correctly, the configurator has no way to receive the rule evaluation results from the Constraint Rules Engine. As a result, Salesforce cannot build a valid configuration session and prevents the configurator from opening.

Resolution Overview:

To resolve this issue, you must:

  1. Create a custom field on required objects
  2. Expose and configure the field correctly
  3. Update the Extended SalesTransactionContext context definition
  4. Map the custom field to context attribute tags
  5. Publish context mappings
Step 1: Create Custom Fields

Create the following custom field on all three objects:

Objects

  • Quote Line Item
  • Order Product
  • Asset Action Source

Field Configuration

PropertyValue
Field NameConstraintEngineNodeStatus
API NameConstraintEngineNodeStatus__c
Data TypeText Area (Long)
Length131,072
Field-Level SecuritySelect Visible, Deselect Read-Only (for users using Constraint Rules Engine)
Page LayoutsDo not add to any page layout

This field is used internally by the Constraint Rules Engine and should not be visible on UI layouts.

Step 2: Update the Extended SalesTransactionContext

Navigate to Setup -> Context Definitions and edit the Extended SalesTransactionContext associated with the default pricing procedure (configured in Revenue Settings).

Step 3: Add Context Attributes
A. Add Attribute for SalesTransactionItem
  1. Go to the Edit Attributes tab
  2. Select SalesTransactionItem
  3. Click Add Attributes
  4. Enter the following:
    1. Name: ConstraintEngineNodeStatus
    2. Type: INPUT OUTPUT
    3. Data Type: String
B. Add Attribute for AssetActionSource
  1. Still on Edit Attributes
  2. Select AssetActionSource
  3. Click Add Attributes
  4. Enter the following:
    1. Name: AssetConstraintEngineNodeStatus
    2. Type: INPUT OUTPUT
    3. Data Type: String

Click Next.

Step 4: Add Attribute Tags
On the Edit Attribute Tags screen:
  1. SalesTransactionItem
    1. Select SalesTransactionItem
    2. Search for ConstraintEngineNodeStatus__c
    3. Add the attribute tag
  2. AssetActionSource
    1. Select AssetActionSource
    2. Search for AssetConstraintEngineNodeStatus__c
    3. Add the attribute tag

Click Save.

Step 5: Map sObject Fields to Context Attributes
A. Quote Line Item Mapping
  1. Open the SalesTransactionContext Context Definition
  2. Go to Map Data
  3. Click Edit sObject Mapping on QuoteEntitiesMapping
  4. Select SalesTransactionItem
  5. Search for ConstraintEngineNodeStatus
  6. Map:

  ConstraintEngineNodeStatus -> QuoteLineItem.ConstraintEngineNodeStatus__c

Click Save and Publish

B. Order Product Mapping
  1. Click Edit sObject Mapping on OrderEntitiesMapping
  2. Select SalesTransactionItem
  3. Search for ConstraintEngineNodeStatus
  4. Map:

ConstraintEngineNodeStatus -> OrderItem.ConstraintEngineNodeStatus__c

Click Save and publish.

C. Asset Action Source Mapping
  1. Click Edit sObject Mapping on AssetEntitiesMapping
  2. Select AssetActionSource
  3. Search for ConstraintEngineNodeStatus
  4. Map:

AssetConstraintEngineNodeStatus -> AssetActionSource.ConstraintEngineNodeStatus__c 

Click Save and Publish

Congratulations! The Constraint Rules Engine is now fully enabled and operational in your org.

Control Product Attributes based on the Quote field

Meet Matt, Product Designer in Laptop World. Pvt Ltd. He wants to control the Laptop Pro Bundle attributes based on the new Quote field:- Channel Partner Tier.

Business Requirement:

Product: Laptop Pro Bundle

Product Structure:

Laptop Pro Bundle

  1. Laptop
  2. Laptop Accessories
    1. Printer Bundle
      1. Printer
      2. Accessories
    2. Mouse
    3. Warranty

In Laptop World Pvt. Ltd., the Channel Partner Tier is a custom field used in quotes to classify business partners based on their:

  • Sales performance
  • Business volume
  • Capabilities and contribution

It helps the company assign specific product rules and restrictions depending on the partner's level.
There are two tiers:

  1. Silver Tier
  2. Gold Tier

Each tier has different permissions and configurations for products.

Silver Tier - Rules and Behavior

When a Channel Partner Tier is classified as Silver, the system applies stricter product settings.

Mouse Product Configuration
  1. The Wireless attribute is automatically set to false
Meaning:

A wired mouse will be the default for Silver partners.

Printer Product Configuration
  1. The Printer type attribute is set to Inkjet
Meaning:

Inkjet will be the default configuration for the Silver partner.

Gold Tier - Rules and Behavior

When a partner is classified as Gold, they receive more flexible and premium product options.

Mouse Product Configuration
  1. The Wireless attribute will be set to true
Meaning:

Gold partners can use or sell wireless mouse products, which are typically considered premium.

Printer Product Configuration
  1. The Printer type attribute will be set to Laser
Meaning:

Gold partners can configure and sell high-end laser printers, which offer better performance and efficiency.

Implementation: Control Product Attributes Using Constraint Rules

In this section, we'll bring your configuration to life by dynamically controlling product attributes based on a Quote-level field using the Constraint Rules Engine. Let's walk through it step by step.

Step 1: Create the Custom Quote Field

We'll start by creating a new picklist field on the Quote object.

Field Details

  • Field Label: Channel Partner Tier
  • API Name: Channel_Partner_Tier__c
  • Data Type: Picklist
  • Values:
    • Silver
    • Gold

This field will drive how product attributes behave in the bundle.

Step 2: Add the Field to the Context Definition

Now, let's expose this field to the Constraint Engine using the Context Definition.

  1. Open the Context Definition where the ConstraintEngineNodeStatus field was configured.
  2. Click Edit.
  3. In the SalesTransaction section, click Add Attributes.

Attribute Configuration

  • Name: Channel_Partner_Tier__c
  • Type: INPUT OUTPUT
  • Data Type: Picklist
  1. Click Next.
  2. On the Edit Attribute Tags screen:
    • Add an attribute tag for Channel_Partner_Tier__c
    • Click Save

This makes the Quote field available to the Constraint Engine.

Step 3: Map the Attribute to the Quote Field

Next, we'll map the context attribute to the actual Quote field.

  1. Go to the Map Data.
  2. Click Edit sObject Mapping on the QuoteEntitiesMapping.
  3. Map:
    • Quote Field: Channel_Partner_Tier__c
    • Attribute: Channel_Partner_Tier__c
  4. Click Save and Publish.
Step 4: Create a New Constraint Model

Now it's time to define the rules.

  1. From the App Launcher, search for Constraint Model.
  2. Open the Constraint Model tab.
  3. Click New Constraint Model.
  4. Enter:
    • Name: New Constraint Model
    • API Name: New_Constraint_Model (auto-populated)
    • Context Definition: Select the Context Definition where the new field is configured
  5. Click Save.

 

Step 5: Add Products to the Constraint Builder
  1. Open the first version of the Constraint Model.
  2. In the Constraint Builder, click Add Item -> Product -> Next.
  3. Select Laptop Pro Bundle.
  4. Click Save.
Step 6: Switch to the CML Editor

Now we'll write the actual constraint logic.

Define an External Variable
An External Variable allows the Constraint Rule Engine to consider a value outside the immediate product configuration when evaluating a rule. Think of it as giving the rule engine an extra piece of information so it can make a smarter configuration decision.

In our example, we are declaring an external variable to retrieve the Quote field value.

At the very top of the CML Editor, add this to fetch the Quote field value from the SalesTransaction context:

@(contextPath = "SalesTransaction.Channel_Partner_Tier__c")
extern string Channel_Partner_Tier__c;
Step 7: Control Mouse Attributes Based on Channel Partner Tier

Use constraint rules to set the Wireless attribute for the Mouse product automatically:

type Mouse : LineItem {
    @(defaultValue = "false")
    boolean Wireless;

    constraint(Channel_Partner_Tier__c == "Silver" -> Wireless == false);

    constraint(Channel_Partner_Tier__c == "Gold" -> Wireless == true);
}
Step 8: Control Printer Type Based on Channel Partner Tier

Apply similar logic for the Printer product:

type Printer : LineItem {
    string Printer_Type = ["Laser", "Inkjet"];

    constraint(Channel_Partner_Tier__c == "Silver" -> Printer_Type == "Inkjet");

    constraint(Channel_Partner_Tier__c == "Gold" -> Printer_Type == "Laser");
}
Step 9: Save and Activate

Once the rules are complete:

  • Click Save
  • Click Activate

Your Constraint Model is now live and dynamically controlling product attributes based on the Channel Partner Tier selected on the Quote!

Demo:

Now that the constraint rule is successfully in place, it's time to put it to the test by creating a new quote and verifying that product attributes update correctly based on the Channel Partner Tier.

Follow the steps below to validate the behavior.

Step 1: Open the Account
  1. From the App Launcher, search for and select the Account object.
  2. In the account list view, switch to All Accounts.
  3. Open the Burlington Textiles Corp of America account.
Step 2: Create a New Quote
  1. In the Related tab of the account record, click New Quote on the Quote related list.
  2. Enter a Quote Name.
  3. Set the Channel Partner Tier to Silver.
  4. Click Save.
Step 3: Browse and Select Products
  1. On the quote record, click the Browse Catalogs quick action.
  2. Select Standard Price Book and click Save.
  3. Select the Hardware Catalog, then click Next.
  4. Search for Laptop Pro Bundle.
  5. Click the settings icon to configure the bundle.
Step 4: Validate Configuration for Silver Tier
  1. In the Laptop Pro Bundle Configuration:
    1. Navigate to the Mouse product configuration.
    2. Confirm that the Wireless attribute is set to False (as expected for Silver tier).


       
  2. Return to the Laptop Pro bundle configuration screen and open the Printer Bundle.
  3. Drill down into the Printer configuration.
    1. Confirm that the Printer Type is set to Inkjet, aligned with the Silver tier.


       
  4. Click Save to add the configured products to the quote.
Step 5: Update the Tier and Re-Validate
  1. Back on the Quote record, update the Channel Partner Tier from Silver to Gold.
  2. Reconfigure the Laptop Pro Bundle.
Step 6: Confirm Configuration for Gold Tier
  1. Review the updated attributes:
    1. Wireless should now be set to True.


       
    2. Printer Type should be updated to Laser.

       
Result:

The constraint rule behaves exactly as intended product attributes automatically adjust based on the Channel Partner Tier, ensuring accurate and controlled configurations every time.

Conclusion

By using Quote fields driven constraint rules in Revenue Cloud, you can make product configuration smarter and more reliable. This approach ensures that product attributes automatically adjust based on business context such as the Channel Partner Tier without any manual intervention. The result is a simpler configuration, fewer errors, and consistent enforcement of business rules, helping sales teams create accurate quotes faster and with greater confidence.


free-consultation