A product administrator needs to add a required rule using Constraint Modeling Language (CML) so that whenever a product called Desktop is added to a quote, another standalone product called Monitor will be automatically added.
What is the correct CML syntax to write this rule?
(150--250 words)
Constraint Modeling Language (CML) defines logical relationships between quote line items, allowing administrators to automate dependency and compatibility logic in Salesforce CPQ.
The keyword require() explicitly establishes a dependency that ensures one product must exist when another is present in a quote.
The correct syntax must define relationships with multiplicity ranges (e.g., [0..99]) and use the require() function, not constraint(), to specify the rule. Option B meets these criteria:
type Quote {
relation desktop : Desktop[0..99];
relation monitor : Monitor[0..99];
require(desktop[Desktop], monitor[Monitor], 'Desktop requires Monitor');
}
This ensures that when ''Desktop'' is added, ''Monitor'' is automatically included. The other options are incorrect because:
Option A uses the wrong function (constraint() instead of require()), which defines logical conditions but doesn't enforce automatic inclusion.
Option C omits multiplicity, which is required for valid relationship definition.
Exact Extract from Salesforce CPQ Implementation Guide:
''The require() statement in CML defines a dependency rule so that when one product is selected, the dependent product is automatically added to the quote.''
Salesforce CPQ Implementation Guide --- Constraint Rules and CML Syntax
Salesforce Revenue Cloud Developer Guide --- Defining Product Relationships in CML
Currently there are no comments in this discussion, be the first to comment!