Loading

Revenue Cloud Product Configurator: setdefault() Quantity Assignment Fails in CML Due to Child Product Declaration Order

Veröffentlichungsdatum: Aug 5, 2026
Beschreibung

When using setdefault() in CML to automatically select a child product and assign it a calculated quantity, the quantity assignment silently fails if the target product is declared before the source product in the bundle sequence.

The CML constraint solver evaluates variables in declaration order across the whole bundle. Group boundaries do not isolate evaluation scope. If the target product appears earlier in the sequence than the source product, the solver processes the target before the source value has resolved, leaving setdefault() with nothing to evaluate against. The assignment fails without throwing an error.

Symptoms:

- setdefault(sourceProduct > 0, targetProduct == calculatedValue) does not update the target product's quantity

- Auto-selection works when used alone but stops working after a quantity assignment is added

- The same logic works correctly when the target product is declared after the source product

 

Example configuration:

- Group 1 contains Child1 and Child2

- Group 3 contains Antivirus

- The following CML works for auto-selection alone:

setdefault(child1[Child1] > 0, antivirus[Antivirus]);

- Adding a calculated quantity assignment fails when Antivirus precedes Child1 in the bundle sequence:

int child2Qty = child1[Child1] * 4;

setdefault(child1[Child1] > 0, antivirus[Antivirus] == child2Qty);

This is confirmed expected behavior, verified by the CML product team.

Lösung

Reorder the child products so the target product appears after the source product in the sequence. This ensures the solver processes the source value before evaluating the target assignment.

Retest the CML constraint to confirm the quantity assignment updates correctly.

Nummer des Knowledge-Artikels

005390615

 
Laden
Salesforce Help | Article