How to use Twin Fields and Special Fields for Salesforce CPQ
Today we are going to talk about one of the most underrated features CPQ has that people should know more about: Twin Fields. We’re also going to mention their cousin: Special Fields.
When we first heard about this feature it reminded us of Quote Sync on Sales Cloud. In fact, Twin Fields and Special Fields bring much more features to what Quote Sync supports. Normally, Quote syncing copies values and products from the Opportunity record it was created from in terms of standard fields and line items. However since you can have more than one Quote linked to an Opportunity record, you can only sync one Quote at a time and you cannot sync custom line item fields as of yet. (By the way, you can vote for this feature here).
You also cannot sync products that have an inactive list price or Pricebook or Product. You would need to edit them as active or delete them if they’re selected as archived. One common error is having an inactive currency left in a multi-currency org and sync a record with that currency. If you have any approval processes currently pending on a quote, you cannot sync another one until the process interview finishes executing.
In CPQ, certain pairs 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.” You can one way map these values between supported objects, including custom fields. You would need to have a Read access on the source field and Edit access on the target field. Standard fields can’t be mapped between objects.
Objects in Column 1 of this table pass field values to custom fields with matching types and API names from the objects in column 2.
In terms of where you would need to use Twin Fields depends on if you regularly update the same values from an object via automation or with Apex in Salesforce. Instead of building these customizations you can use Twin Fields to map data across supported objects and yourself platform resources. This feature can especially be a lifesaver in a large volume data org. A great example of using a Twin field is when you have a field value copied from a Product copied across all Quote Line Items it’s generated from. This feature also does not require you to activate it on setup. You can simply use it by following the conditions listed above.
The potential drawbacks for this mapping is that you need to work with standard objects since Custom Objects are not supported and check the objects you will be using are supported. You need to also have the exact API name, not the labels. One common mistake is to have different field types since this is also not supported.
When a bundle is configured, objects in Column 1 transfer their values to the emerging new quote lines. When you access the configurator to reconfigure the bundle, Salesforce CPQ sets product options and configuration attribute values based on matching field values from their related quote lines.
Note: If you mark a bundle a Favorite and then add that favorite bundle to the quote line editor, it won't seize any twin field values.
Tip: If your twin fields are not mapping from one object to another, go to Setup>Quick Find>Installed Packages and click the Configure link next to the Salesforce CPQ package. Then, go to the Additional Settings tab and try taking the "Post Install Steps" by clicking Execute Scripts and retesting your twin fields. Source: (Also shoutout to John Garvens!)
Another key point is that twin fields are populated only upon record creation, so editing the source will not copy the value to it’s target.
The below diagram shows the mapping direction between Twin Fields on various objects that happen in Salesforce CPQ and Salesforce Billing at certain automation.
We also need to talk about Special Fields here which are fields you can create to unlock advanced features of the CPQ package. Here’s a list of CPQ Special Fields you can use to aid your CPQ implementation.
For example you want to customize Quote fields in the Quote Line Editor for different users: Can the 'Line Editor' field set on Quote be customized for different users? This is for Quote, not Quote Lines. The desired outcome is one group of users see a certain set of Quote fields, whereas another group see different Quote fields when configuring a Quote.
The answer is yes: With the Salesforce CPQ Special Field, HeaderFieldSetName, you can create a field on the quote object to dynamically display a specific quote field in the quote line editor. You can choose to control the quote field set that is displayed by using a formula field or you can allow users to make their own selection by using a picklist field.
Here are the necessary steps:
In Part 4 we cover truncation, search optimization, indexing nulls, API performance and other optimization techniques to keep your Salesforce org performant.
How Atlassian uses Bitbucket, JIRA and other cloud tools to help Salesforce developers collaborate.