Loading
Prepare for Email to Become the Default Login ExperienceRead More
Get Started with Communications, Media, and Energy & Utilities (CME)...
Setting Up an Attribute Configuration Rule to Modify Attributes Across Line Items

Setting Up an Attribute Configuration Rule to Modify Attributes Across Line Items

This topic provides an example of how to define a configuration rule in which a parent line item modifies the attributes of a child line item.

In this example, the parent must have a quantity greater than one and an attribute memory size of 16GB.

Attribute Modification Rule

In this example, you create a configuration rule with one action. Pair the action with a filter to qualify the triggering product that checks the quantity and the memory attribute value. Create configuration rules against the Line item objects (Opportunity Line Item, Quote Line Item, or Order Item). This example is for the Order Item, with a product relationship of type Modify Attributes, and an action parameter JSON describing the actions to be against the target line item.

Note
Note Ensure that the Has Rule flag is enabled for each attribute that has a rule. If the flag isn’t enabled for an attribute, the runtime user interface bypasses the required APIs and the rule doesn’t apply to the attribute. You can enable the Has Rule flag from Vlocity Product Designer. For more information, see Enable the Has Rule flag.
Note
Note You must set the CPQ Configuration Setup setting 'ResetUserValueForPCP=true’, while migrating to Standard Cart APIs. This verifies both the Include and Exclude Constraint rules function correctly at runtime, especially if you're switching between multiple rules.

Verify that the has rule flag is enabled for each attribute with a rule. Failure to set that flag results in the runtime user interface bypassing the required APIs, so the rule will not apply.

Product Detail

Product relationship of type Modify Attributes considerations:

  • The rule supports two attribute modification contexts: Bundle and Cart. Selecting Bundle causes the rule to apply the actions to the related product within the same bundle of the triggering line item. Selecting Cart applies the actions to the related product within the cart.

  • The action parameters JSON can be created using the product configuration procedure editor. Once created the JSON can be moved to the product relationship. Make sure to delete the mock product configuration procedure once the JSON is copied.

  • The rule supports a self action by leaving the related product field empty, the actions are applied to the triggering product.

To create the rule:

  1. Verify the Prerequisites are Configured.
  2. Create the Product Relationship.
  3. Create the Entity Filter.
  4. Create the Rule in the Vlocity Rule Builder.

Verify the Prerequisites are Configured

Before configuring the rule:

  • Create all the entity filters used within the rule actions.

  • Create all the action procedures used within the rule actions.

Create the Product Relationship

This product relationship defines the triggering product Test Attribute Config Prod which modifies the attributes of the related product Test Attribute Config Prod Child1 in the context of the cart applying the defined action parameters.

Test Attribute Config Prod

For the Actions Parameter field, see Create Action Parameter JSON with Product Configuration Procedure.

Create the Entity Filter

This entity filter is associated with the rule action to qualify the triggering line item that checks if the memory size is equal to 16GB and the quantity is larger than 1.

Entry Filter

Create the Rule in the Vlocity Rule Builder

To create the rule:

  1. Navigate to the Rules tab.
  2. Click New.
  3. Associate all the elements with one another.

Create Action Parameter JSON with Product Configuration Procedure

Product relationships use JSON for the action parameters. To generate this JSON, create a product configuration procedure.

Before You Begin

  • Create the required product.

  • Create the required attributes and, if applicable, picklists.

After you save the product configuration procedure, you can view the Action Parameters code on its Details tab. You can copy the code and paste it into a product relationship's Action Parameters field.

  1. In the Product Configuration Procedures tab, click New.

    To open the Product Configuration Procedures tab, search for it from the App Launcher.

  2. Enter a name for the configuration, and select a product.

    To search for a product, you must enter at least one character, and then click the magnifying glass icon. You can then select a product from the results, and click Save.

  3. Select an attribute to modify.
  4. Click the + button to add a configuration line for the attribute.
  5. Click Add Action.
  6. Select an applicable action.

    Action

    Description

    Constrain

    Include or exclude certain picklist entries.

    Assign

    Assign a value to any type of attribute.

    Disable

    Disable an attribute of any type.

    Require

    Mark an attribute of any type as required.

    Hide

    Hide attribute in the UI. The attribute definition is still in the JSON, but it's hidden from the user.

  7. Select the action type, which varies depending on the action.
    • Disable, Require, and Hide have Yes and No options.

    • Constrain has Exclude and Include options.

    • Assign has no action types.

  8. Select an attribute value.
    • For Constrain, select the attribute to include or exclude.

    • For Assign, enter the value to set for the attribute.

    • Disable, Require, and Hide require no attribute value.

  9. Click Save after you specify all the attribute actions and values for a product.
  10. In the Details tab for the saved configuration, copy the JSON for the Action Parameters field, and paste it to your Product Relationship.
    Action Parametrs field
 
Loading
Salesforce Help | Article