---
schema_version: "1"
id: c0240c0e23ca7d355b06a752a7ee0fa65d9a250915856cd6a6b5739824bd9a19
title: Map Custom Fields for Lead and Opportunity Products and Preferred Sellers
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/auto_map_custom_fields_lead_opportunity.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.auto_map_custom_fields_lead_opportunity.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4fc1d9c80b6769af3b57e9d91f70e9e79f16075d0fd88730121fca48916509d2
description: Create custom fields on Lead Line Item and Lead Preferred Seller objects to suit your business requirements. Create similar custom fields on Opportunity Product and Opportunity Preferred Seller objects. Then, use the ObjectRelationshipHierarachy Metadata API to map the custom fields between the source and target objects. If the lead is converted to an opportunity, these custom field values are automatically populated when the Lead Line Item and Preferred Seller records convert to Opportunity Line Item and Preferred Seller records.
products:
  - Automotive
release: "264"
---
# Map Custom Fields for Lead and Opportunity Products and Preferred Sellers

Create custom fields on Lead Line Item and Lead Preferred Seller objects to suit your business requirements. Create similar custom fields on Opportunity Product and Opportunity Preferred Seller objects. Then, use the ObjectRelationshipHierarachy Metadata API to map the custom fields between the source and target objects. If the lead is converted to an opportunity, these custom field values are automatically populated when the Lead Line Item and Preferred Seller records convert to Opportunity Line Item and Preferred Seller records.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions.</td></tr></tbody></table>

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-automotive-264-0-0-production-enus/55098325-b838-4fed-9e79-8cfa2d7b33a3/images/icon_example.png)

Example

A company wants to capture the warranty that a customer is interested in buying. To capture the warranty, the company creates a custom field on Lead Line Item with these details:

- Name: Warranty
- Field Data Type: **Lookup Relationship**
- Related To: **Asset Warranty**

The company creates the same field on Opportunity Product.

The company then creates a mapping file with these details:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:50%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d112303e91">Mapping Attribute</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d112303e94">Value</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Mapping Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e91 ">Input Object</td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e94 ">
                  <p>Name of the input object type that contains the source fields for mapping. </p>
                  <p style="margin-bottom:0;">Lead Line Item</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Mapping Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e91 ">Output Object</td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e94 ">
                  <p>Name of the output object type that receives data conversion. </p>
                  <p style="margin-bottom:0;">Opportunity Line Item</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Mapping Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e91 ">Input Field</td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e94 ">
                  <p>Field in the input object.</p>
                  <p style="margin-bottom:0;">Warranty</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Mapping Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e91 ">Output Field</td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e94 ">
                  <p>Field in the output object.</p>
                  <p style="margin-bottom:0;">Warranty</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Mapping Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e91 ">Usage Type</td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d112303e94 ">
                  <p>Name of the usage where the mapping is used.</p>
                  <p style="margin-bottom:0;">TransformationMapping</p>
                </td>

              </tr>
            </tbody>
          </table>