Use Case: Setting a Multi-Attribute Price
This use case shows you how to use a Lookup Value in a rule that will set the Effective Price of a Product in a Quote to the value of the List Price in a record of a custom object Price Table Entry.
Set up Lookup Table Data for the Use Case
- Create a new custom object Price Table Entry with the following fields:
- Ownership (Text)
- Lead Source (Text)
- List Price (Number)
- Create one record of Price Table Entry and set the field values as follows:
- Ownership: Public
- Lead Source: Web
- List Price: 99
- Optionally, create other records with different values.
Create the Rule
- In the Rules tab, click New and add the following rule.
- Rule Name: Set Price Based on Attributes
- Active: Select the field.
- Define a Condition that checks if the Quote has Products.
- In the CONDITION section, click Add Criteria....
- In the first Attribute Type field, click and select Rollup Value.
- In the Object field, click and select Rate Plan.
- In the Rollup Type field, click and select Count.
- Change the is equal to to is greater than in the pick list.
- In the second Attribute Type field, click and select Static Value.
- In the Value field, type 0.
- Define the Action that sets the Effective Price based on the Price Table Entry records.
- In the ACTIONS section, click Add Action....
- In the Action Type field, click and select Update Product.
- In the Object field, click and select Charge.
- In the Field field, click and select Effective Price.
- In the New Value Type field, click and select Lookup Value.
- In the Lookup Object field, select Price Table Entry.
- In the Value Name field, select List Price.
- For Attribute 1, select Ownership.
- For Attribute Value Type, select Object Field Value.
- Click on Object Field, and select Quote > Account > Ownership.
- Click the + button next to Attribute 1 to add a second attribute.
- For Attribute 2, select Lead Source.
- For Attribute Value Type, select Object Field Value.
- Click on Object Field, and select Quote > Opportunity > Lead Source.
- In the Message field, type "Charge Price updated."
- Click Save.
Verify the Rule
- Create or update an Account and set the Ownership value to Public.
- Under that Account, create or update an Opportunity. Set the Opportunity's Lead Source value to Web.
- Under this Opportunity, create a New Subscription Quote.
- In the Guided Selling flow, add a Per Unit product to the quote.
- In the Edit Products page, verify that the Effective Price of the product is updated to 99.
- The Rules Engine Logs section will show the message "Charge Price updated." that you have specified in the rule.
- Optionally, update the Account's Ownership or the Opportunity's Lead Source values to other values that match a Price Table Entry. Refresh the product selection to validate the new effective price matches this Price Table Entry's List Price field.
- Note that you must ensure that any valid combination of attribute inputs matches at least one record of the Lookup Object when you use the multi-attribute pricing rule. Otherwise, the price calculation will not be possible.
- Lookup Object records can also contain a wildcard character "*" in an attribute field to match against any input value.