Custom Settings – Field Metadata

What. in tarNATION. is THAT?! Hey I found a custom setting that is in CPQ but I have no idea what it does or how it fits into the CPQ system. Here’s an answer! Honestly not sure if this is 100% accurate but this is what I’ve learned so far.

There’s no docs that I’ve ever seen but it has to do with the fields used in price rules. This is one of the tables that get set up when you run execute scripts. It’s what the error means when  you add a field (that doesn’t exist) to a Price Rule: “No Metadata found for field <fieldname>.” It’s basically a list of fields (and their objects) that are referenced in price rules. You don’t have access to the data for this. So opening up and managing the data in this Custom Setting doesn’t show you anything. This data is internally managed by CPQ.

Also! Chris Hickman notes:

“Back in the pre-Lightning UX days, which were predominantly when “Salesforce CPQ” was still “SteelBrick” (or even “Quote Quickly” before that), the “New Quote” button on Opportunity “did” a lot more than the Lightning UX-equivalent does, in terms of pre-populating fields, even during new record creation prior to save. You could take this even further by adding records to the Field Metadata custom setting. There was extensive documentation for this in the old SteelBrick community which unfortunately did not survive the Salesforce acquisition.”

Below is a complete set of documentation lifted from this article. Keep in mind, this old feature of CPQ used “URL hacking” which only works in classic. It’s also not a best practice to use this type of “URL hacking” in general.

A specific set of fields on Quote can be auto-populated from the associated Opportunity and Account at the time of creating a new Quote.

If you do not do the necessary setup, sales reps would spend time re-entering Quote fields which were already filled in at the time of creating Opportunity and Account.

New Quote Creation Page WITHOUT auto-populated fields
New Quote Creation Page WITHOUT auto-populated fields

Salesforce CPQ provides a Field Metadata custom setting where we can set up the fields that we want to be pre-filled with the corresponding values on Quote creation.

AUTO-POPULATE Fields on New Quote Creation
New Quote Creation Page WITH auto-populated fields

Use Case

John Cook works as a CPQ Administrator at Universal Containers (UC). Usually, Sales reps at UC go through Account -> Opportunity -> Quote flow to create new Opportunities and Quotes.

While creating a new Opportunity from an Account, lookup to that Account gets set on the Opportunity. While creating a new Quote from an Opportunity, lookup to that Opportunity gets set but, lookup to the Opportunity’s Account DOESN’T get set on the Quote. Reps have to explicitly select the corresponding Account in Account field on the Quote.

Sales Reps expect that the system should be smart enough to automatically pre-populate the Account lookup on Quote with its Opportunity’s Account.

How to Setup?

  1. Navigate to Setup | Develop | Custom Settings | Field Metadata. Click ManageField MetadataField Metadata
  2. Click New on the Field Metadata page.
  3. Enter the Name, Field Name and Object Name of the Field you want to auto-populate where
    • Name: SFDC ID of Account Field (SFDC ID of the Quote Field)
    • Field Name: SBQQ__Account__c (Quote Field API Name)
    • Object Name: SBQQ__Quote__c (API Name of the Object)New Field Metadata Custom Setting RecordNew Field Metadata Custom Setting RecordNew Field Metadata Record
  4. To get the Account Field SFDC ID, navigate to Setup | Build | Create | Objects | Quote | Account Field. Copy the SFDC ID from the address URL of this page.Account Field on QuoteAccount Field on Quote
  5. Click Save.

Check if it works as expected

  1. Navigate to the Opportunity on which you want to create a new Quote, go-to Quotes Related List and click New button.Opportunity Page- Account DetailsOpportunity Page- Account Details
  2. Once done, you can see that the Account field on Quote gets pre-filled with the associated Opportunity’s Account i.e. Genepoint.Account Field pre-populated with Opportunity's Account on QuoteAccount Field pre-populated with Opportunity’s Account on Quote
  3. Repeat for the other Fields that you want to be auto-populated.All records in Field Metadata Custom SettingAll records in Field Metadata Custom SettingAll records in Field Metadata
  4. When you click New Quote button in Quotes related list on Opportunity, you can see that the AccountSales Rep and Billing & Shipping Address fields on Quote are auto-populated with the information from associated Opportunity and Account.AUTO-POPULATE Fields on New Quote CreationQuote Creation Page WITH auto-populated fields


Supported Fields – 

  • You can configure the following fields to auto-populate on a quote:
Billing CitySBQQ__BillingCity__c
Billing CountrySBQQ__BillingCountry__c
Billing NameSBQQ__BillingName__c
Billing Postal CodeSBQQ__BillingPostalCode__c
Billing StateSBQQ__BillingState__c
Billing StreetSBQQ__BillingStreet__c
Primary ContactSBQQ__PrimaryContact__c
Sales RepSBQQ__SalesRep__c
Shipping CitySBQQ__ShippingCity__c
Shipping CountrySBQQ__ShippingCountry__c
Shipping NameSBQQ__ShippingName__c
Shipping Postal CodeSBQQ__ShippingPostalCode__c
Shipping StateSBQQ__ShippingState__c
Shipping StreetSBQQ__ShippingStreet__c

Billing Address Fields

  • When billing address fields are set to auto-populate, bill-to information is pulled from either the distributor, partner or direct account present on the Opportunity:
    • By default, bill-to information is pulled from the distributor account.
    • If there is no distributor account present on the opportunity, billing information is pulled from the partner account.
    If there is no partner account present on the opportunity, billing information is pulled from the direct account i.e. Opportunity’s Account.

Shipping Address Fields

  • When shipping fields are set to auto-populate, ship-to information is pulled from the direct account present on the Opportunity. If ship-to information within the direct account is empty, the auto-populating fields will instead pull the values from bill-to information.

Special Fields on Opportunity

  • You need to create special fields on Opportunity to auto-populate below fields on the Quote.
Primary ContactQuotePrimaryContact__c

Sales Rep Field on Quote

  • If “SBQQ__SalesRep__c” field is added in the Field Metadata custom setting, Quote’s Sales Rep field is pre-filled with the value from Opportunity’s Owner field.
  • Navigate to the Opportunity on which you want to create a new Quote, go-to Quotes Related List and click New button.
    Opportunity Page- Owner Details
    • You can see that the Sales Rep field on Quote gets pre-filled with the associated Opportunity’s Owner i.e. JASON LIVESTON.Sales Rep Field pre-populated with Opportunity's Owner on QuoteSales Rep Field pre-populated with Opportunity’s Owner on Quote


    Salesforce CPQ uses URL Hacking to implement this feature. This is the reason why it works in Salesforce Classic ONLY and NOT in Lightning Experience. As a workaround, you can think about leveraging Publisher Actions/Quick Actions to pre-populate the Quote fields.

    Lightning UX

    This does not work in Lightning UX AFAIK. However, in 2022, you have 2 no-code options that replace this:

    1. Create a Quick Action on Opportunity and predefine field values on your resultant Quote record

    2. Create a screen flow, which allows you to add in all of the other stuff Flows can do. One example application of this Chris Hickman wrote about is here.


    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.