---
schema_version: "1"
id: 941b0570505f10a50749603efd03a7af8e2b267d68d028e5627d9bd50bf76dd6
title: ObjectHierarchyRelationship
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/automotive_cloud/auto_metadata_api_objecthierarchyrelationship.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.automotive_cloud.meta/automotive_cloud/auto_metadata_api_objecthierarchyrelationship.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 43179b07e7862bb2f9e95e3e324fe14165af0a6e37be54c390b0a6e3adc40580
description: Represents an organization’s field mappings for conversion of a lead’s related records to an opportunity’s related records. Fields can be mapped from LeadLineItem and LeadPreferredSeller to OpportunityLineItem and OpportunityPreferredSeller respectively.
---
# ObjectHierarchyRelationship

Represents an organization’s field mappings for conversion of a lead’s related records to an opportunity’s related records. Fields can be mapped from LeadLineItem and LeadPreferredSeller to OpportunityLineItem and OpportunityPreferredSeller respectively.

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/metadata.htm "HTML (New Window)") metadata type and inherits its fullName field.

![Note](https://developer.salesforce.com/docs/atlas.en-us.automotive_cloud.meta/automotive_cloud/images/icon_note.png)

#### Note

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

## File Suffix and Directory Location

ObjectHierarchyRelationship components have the suffix ObjectHierarchyRelationship.settings and are stored in the ObjectHierarchyRelationship folder.

## Version

ObjectHierarchyRelationship components are available in API version 51.0 and later.

## Fields

### childObjectMapping

- **Field Type**: [ObjectMapping](#auto_metadata_api_objecthierarchyrelationship_objectmapping)
- **Description**: Set of inputObject, mappingFields, and outputObject entries. For example, fields from the input object of LeadLineItem maps to fields of the output object of OpportunityLineItem.

### inputObjRecordsGrpFieldName

- **Field Type**: string
- **Description**: The field name in the input object used to group the records. This field is available in API version 55.0 and later.

### mappingType

- **Field Type**: ObjHierarchyMappingType (enumeration of type string)
- **Description**: Specifies the type of relationship between two objects. This field is available in API version 55.0 and later.
    
    ![Note](https://developer.salesforce.com/docs/atlas.en-us.automotive_cloud.meta/automotive_cloud/images/icon_note.png)
    
    #### Note
    
    Use ParentToParent
- **Possible values**:
    - ChildToChild
    - ParentToChild
    - ParentToParent
    - Support

### masterLabel

- **Field Type**: string
- **Description**: Label name of the mapping definition.

### outputPntRelationshipFieldName

- **Field Type**: string
- **Description**: The field name that defines the relationship between a parent and child for the output object. This field is available in API version 55.0 and later.

### parentObjectMapping

- **Field Type**: [ObjectMapping](#auto_metadata_api_objecthierarchyrelationship_objectmapping)
- **Description**: Required.
    
    Set of inputObject, mappingFields, and outputObject entries. For example, fields from the input object of LeadLineItem maps to fields of the output object of OpportunityLineItem.

### parentRecord

- **Field Type**: string
- **Description**: The parent record for this object hierarchy relationship. This field is available in API version 55.0 and later.

### parentRelationshipFieldName

- **Field Type**: string
- **Description**: Name of the field that defines the relationship between the parent and child.

### usageType

- **Field Type**: MappingUsageType (enumeration of type string)
- **Description**: Required.
    
    Name of the usage type of an object hierarchy relationship.
- **Possible values**:
    - ConvertToSalesAgreement
    - CLMFieldMapping
    - EligibleProgramRebateType
    - MapJournalToMemberAggregate
    - TransformationMapping

## ObjectMapping

Represents a set of inputObject, mappingFields, and outputObject entries.

### inputObject

- **Field Type**: string
- **Description**: Required.
    
    Name of the input object type containing the source fields for mapping. For example, LeadLineItem or LeadPreferredSeller.

### mappingFields

- **Field Type**: [ObjectMapping​Field](#auto_metadata_api_objecthierarchyrelationship_objectmappingfield)
- **Description**: Mapping of source object input fields to target object

### outputObject

- **Field Type**: string
- **Description**: Required.
    
    Name of the output object type receiving data conversion. For example, OpportunityLineItem or OpportunityPreferredSeller.

## ObjectMappingField

Represents a set of inputField and outputField entries.

### inputField

- **Field Type**: string
- **Description**: Required.
    
    Field in the object specified by the inputObject field in [ObjectMapping](#auto_metadata_api_objecthierarchyrelationship_objectmapping). This field is mapped to the field in outputField, which is a field in the object specified by the outputObject field in [ObjectMapping](#auto_metadata_api_objecthierarchyrelationship_objectmapping).

### outputField

- **Field Type**: string
- **Description**: Required.
    
    Field in the object specified by the outputObject field in [ObjectMapping](#auto_metadata_api_objecthierarchyrelationship_objectmapping). This field is mapped to the field name in inputField, which is a field in the object specified by the inputObject field in [ObjectMapping](#auto_metadata_api_objecthierarchyrelationship_objectmapping).

## Declarative Metadata Sample Definition

The following is an example of a ObjectHierarchyRelationship component.

<?xml version="1.0" encoding="UTF-8"?>
<ObjectHierarchyRelationship xmlns="http://soap.sforce.com/2006/04/metadata">
 <parentObjectMapping>
     <inputObject>LeadPreferredSeller</inputObject>
     <outputObject>OpportunityPreferredSeller</outputObject>
       <mappingFields> 
       <inputField>AccountId</inputField>
       <outputField>AccountId</outputField> 
     </mappingFields> 

     <mappingFields> 
       <inputField>AccountRole</inputField>
       <outputField>AccountRole</outputField> 
     </mappingFields>

     <mappingFields> 
       <inputField>Name</inputField>
       <outputField>Name</outputField> 
     </mappingFields>

 </parentObjectMapping>
    <outputPntRelationshipFieldName/>
    <inputObjRecordsGrpFieldName></inputObjRecordsGrpFieldName>
    <parentRecord/>
    <mappingType>ParentToParent</mappingType>
    <usageType>TransformationMapping</usageType>
</ObjectHierarchyRelationship>

The following is an example package.xml that references the previous definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types\>
      <members\>\*</members\>
      <name\>ObjectHierarchyRelationship</name\>
    </types\>
    <version\>56.0</version\>
</Package\>

## Usage

Use the deploy() call to deploy metadata with a .zip file. Every .zip file contains a project manifest, a file that’s named package.xml, and a set of directories that contain the components. The manifest file defines the components that you’re trying to retrieve or deploy in the .zip file. The manifest also defines the API version that’s used for the deployment or retrieval.

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm "HTML (New Window)").