Auto Mapping/Twin Fields in Salesforce CPQ
This is an amazing feature in CPQ where we can see without customization, writing the apex code application pass value from one object to another using "Configuration Attributes" and "Twin field"
Twin field: Certain pair of CPQ Objects pass custom field values from the first object to the second object when the second object is created. The values pass if the custom fields are editable, have matching field types, and have matching API names. We call these field pairs "Twin fields".
Example - Product Option(Configuration Attribute) and Quote Line.
If we want to map picklist field "Location__c" exists in Product to Quote line , then go to Quote line object and create exactly the same picklist field name "Location__c", that's it. Now if you set some value to that field in product the value automatically will be available on Quote line, this value can be used later for some filtering.
Configuration Attributes: Configuration attribute is the field which drives your product configuration at the Product Option level. Depending on that configuration attribute your product selection is available for agent.

Lets assume you are running your Travelling business in India in North, East, West, South regions. Now you need to configure the cart for 4 different regions and provide filter where user can see list of sites in cart based on "Hills" OR "Beaches"
How we can implement this requirement without wrting the code?
No worry, let's see below
Requirement
Design Cart for different regions and based on filter, Products should be displayed in Cart.
Sample Design: Need to implement below Cart
Implementation
Bundle Product - Travelling Catalogue
Features/Category - North, East, West, South
Options - Travelling Sites Option created under each feature
Configuration Attribute - Hills, Beaches(Picklist values)
STEP 1
Define custom field "Location__c" in Product Option and Quote Line object
- Field Name: Location
- Data Type: Picklist
- Picklist values: Hills, Beaches
Copy API (Location__c) for Location field
STEP 2
Go to object "Configuration Attributes"->Open "Target Field"->Add API Location__c in Target field Picklist
STEP 3
Go to object "Error Condition"->Open "Tested Field"->Add API Location__c in Tested field Picklist
STEP 4
Go to Tab Product->Open Bundle Product - Travelling Catalogue->Add new Configuration Attribute record
- Attribute Name - Location Filter
- Target Field - Location__c
- Row order -10
- Column Order -1
- Position - Top
- Apply immediately checkbox -Checked
STEP 5
Create "Product Rules" with below values
Go to Tab Product Rules->New
Product Rule Name - ShownHillsPackages
Type - Selection
Scope - Product
Active - True
Condition Met - All
Evaluation Event - Always
Create "Error Conditions" in same Product Rule "ShownHillsPackages"
Error Conditions->New
Rule - ShownHillsPackages
Tested Object - Configuration Attributes
Tested Field - Location__c
Operator - Equals
Filter type - value
Filter value - Hills
Note: If field "Location__c" is not visible in "Tested Field" picklist then please execute below steps
1. Go to Object "Error Condition" in setup-> Open "Tested Object" field
2. Scroll down and go to related list "Field Dependencies"
3. Click on "Edit" link
4. Select "Location__c" for Quote, Quote Line, Product Option and Configuration Attributes.
5. Click on "Include values" button and save.
6. Now you will see "Location__c" in Tested Field picklist in Error conditions.
Create "Actions" in same Product Rule - "ShownHillsPackages"
If above error condition is TRUE then "Actions" will be performed.
Example: If user selects "Hills" from Location picklist then all Hills related tourist packages should be displayed in cart and remove others. Same for "Beaches", if user selects "Beaches" then all Hills related packages should be removed from cart.
Let's create "Actions" here from action related list in Product Rule.
Rule - ShownHillsPackages
Type - Show
Product - Himachal
Create multiple actions where Type =show for all product options which you want to display for "Hills".
Rule - ShownHillsPackages
Type - Hide & Remove
Product - Goa
Create multiple actions where Type =Hide & Remove for all product options which you don't want to display for "Hills"or remove all beaches.
See below sample Ations created.
Create "Configuration Rules" in same Product Rule - "ShownHillsPackages"
Open Product Rule-"ShownHillsPackages"->Go to related list "Configuration Rules"->New
Product - Travelling Catalogue
Save the Rule
Note: Configuration Rule is mandatory for each Product rule otherwise it will not work(CPQ managed package inbuilt feature)
STEP 6
Create second "Product Rules" with below values
Go to Tab Product Rules->New
Product Rule Name - ShownBeachesPackages
Type - Selection
Scope - Product
Active - True
Condition Met - All
Evaluation Event - Always
Create "Error Conditions" in same Product Rule - "ShownBeachesPackages"
Error Conditions->New
Rule - ShownBeachesPackages
Tested Object - Configuration Attributes
Tested Field - Location__c
Operator - Equals
Filter type - value
Filter value - Beaches
Create "Actions" in Product Rule - "ShownBeachesPackages"
If above error condition is TRUE then "Actions" will be performed.
Example: If user selects "Beaches" from Location picklist then all Beaches related tourist packages should be displayed in cart and remove others.
Rule - ShownBeachesPackages
Type - Show
Product - Goa
Create multiple actions where Type =show for all product options which you want to display for "Beahces".
Rule - ShownBeachesPackages
Type - Hide & Remove
Product - Himachal
Create multiple actions where Type =Hide & Remove for all product options which you don't want to display for "Beaches"or remove all Hills. (Please follow same steps as you did for Hills above)
Run the application and see your cart as per above implementation.
If you like my blog please comment and share your CPQ Live experience. Let me know if you have any query :)
Related Blogs: