Skip to main content

Modify Attributes

Learning Objectives

After completing this unit, you’ll be able to:

  • Build the action parameters that describe how attributes are modified.
  • Create a product relationship to modify a product’s attributes.
  • Use an advanced rule to trigger the new product relationship.

Get Started with Attribute Modification

So far you’ve observed Eliza Young, the CPQ developer at Infiwave using relationship types such as Recommends, Excludes, or Requires to create product relationships. Suppose there’s an issue with product selection or configuration. In that case, these relationship types just display an alert to the user warning them from progressing the opportunity, quote, or order, to the next stage. However, Eliza wants to do more. She wants to empower the users to fix the issue. She turns to Industries CPQ rules for help.

Product relationships include a second kind of relationship type that doesn’t provide an alert but performs an action. Examples of such relationship types include Auto-Add, Auto-Remove, Auto-Replace, and Modify Attributes, as shown here.

The relationship types that help perform an action.

In this unit, you use the relationship type Modify Attributes and create an advanced rule to modify the attributes of a product in the Cart.

Build the Action Parameters

The Infiwave Product Management team has introduced a new Business Video Service product that requires a high-bandwidth broadband connection. They want Eliza to create a validation rule to ensure that Download Speed attributes less than 200 Mbps are not shown to the customer.

The best way to fulfill this requirement is by creating a new product relationship that modifies the attributes of the Broadband Cable Service product when the Business Video Service is in the Cart. To do this, Eliza must describe how the attributes are modified. This information is stored in JSON notation in the Action Parameters field of the product relationship. So, as a first step, she must write the attribute picklist modifications list using JSON notation.

Eliza uses a point-and-click JSON generator tool called the Product Configuration Procedures to help generate a list of action parameters. She starts by building the code, which excludes 10 Mbps, 55 Mbps, and 100 Mbps options from the Download Speed attribute of the Broadband Cable Service product.

Follow along with Eliza in your training playground.

  1. From the App Launcher, find and select Product Configuration Procedures.
  2. Click New.
  3. Add these details.
    • In the Configuration Procedure Name field, enter JSON Generator.
    • For Select a product, select Broadband Cable Service.
    • For Add Attribute, select Download Speed.
    • Next to the Download Speed attribute, click +. A new button, Add Action, appears under the Download Speed heading.
      The Product Configuration Procedure page.
  4. Exclude 10 Mbps from the Download Speed attribute.
    • Click Add Action.
    • In the first dropdown, select CONSTRAIN.
    • In the second dropdown, select Exclude.
    • Click Select Options and select 10 Mbps.
  5. Repeat step 4 to exclude 55 Mbps and 100 Mbps from the Download Speed attribute. The three actions to exclude 10 Mbps, 55 Mbps, and 100 Mbps from the Download Speed attribute.
  6. Save your changes.
  7. On the Product Configuration Procedure page, copy the JSON in the Action Parameters section and paste it into a text editor.

The JSON in the Action Parameters section that describes the attribute modification.

The action parameters for the Download Speed in JSON is ready.

Create the Product Relationship

Next, you create a new product relationship to modify the Broadband Cable Service’s attributes. Use the action parameters code you built using the Product Configuration Procedures to perform the attribute value exclusions.

  1. From the App Launcher, find and select Vlocity Product Designer.
  2. From the navigation menu, select Product Relationships.
  3. Click New.
  4. In the New Product Relationship window, provide these details.
    • In the Product Relationship Name field, enter Business Video Modifies Broadband Cable Attributes.
    • For Product, select Business Video Service.
    • In the Relationship Type field, select Modify Attributes.
    • For Related Product, select Broadband Cable Service.
    • In both the Min Quantity and Max Quantity fields, enter 1.
    • In the Action Parameters field, paste the action parameters code from the text editor.
    • For Attribute Modification Context, select Cart.
    • Save your changes.

The newly created product relationship details page.

With the product relationship in place, move to the next step: creating an advanced rule.

Define the Advanced Rule

You have built the code that describes the attribute modification and created the product relationship that uses this code to perform the attribute value exclusions. It's time to bring it all together by creating an advanced rule that uses the new Modify Attributes product relationship.

  1. From the App Launcher, find and select Vlocity Rules.
  2. Click New.
  3. Provide these details.
    • In the Rule Name field, enter Attribute Mods Actions Rule.
    • In the next line, for the three dropdowns, select Configuration, Order Product<OrderItem>, and Active respectively.

The rule name and definition for the Attribute Mods Actions Rule.

Next, add the product relationship that appears under Actions within the Vlocity Rule Builder.

  1. In the Filters And Actions List, click Actions to view all the product relationships.
  2. Locate Business Video Modifies Broadband Cable Attributes and click Add To Rule Action.

The Modify Attributes product relationship added as an action in the Attribute Mods Actions Rule.

  1. Save your changes.

The new rule is now ready for use.

Test the Rule in the Cart

To ensure the advanced rule works as desired, follow these steps.

  1. Create a new order for the B2B customer, Acme.
  2. Add the Business Video Service and Broadband Cable Service products to the Cart. You get an alert indicating a missing attribute configuration for the Broadband Cable Service product.
  3. From the line item action menu, select Configure.

The alert indicating a missing attribute configuration for the Broadband Cable Service product.

  1. Click Download Speed.

The Download Speed attribute of the Broadband Cable Service product showing only 200 Mbps as a picklist value.

Notice that only one picklist value is available for the attribute—200 Mbps. The 10 Mbps, 55 Mbps, and 100 Mbps options no longer appear under the Download Speed attribute of the Broadband Cable Service product. The configuration advanced rule is working as desired.

You have successfully created an advanced rule to modify the attributes of a product in the Cart. In the next unit, you create rules to reverse this attribute modification. Stay tuned!

Resources

Compartilhe seu feedback do Trailhead usando a Ajuda do Salesforce.

Queremos saber sobre sua experiência com o Trailhead. Agora você pode acessar o novo formulário de feedback, a qualquer momento, no site Ajuda do Salesforce.

Saiba mais Continue compartilhando feedback