ObjectHierarchyRelationship

Represents an organization’s custom field mappings for sales agreement conversion. Fields can be mapped from Opportunity and Quotes to SalesAgreement and SalesAgreementProduct.
This type extends the Metadata metadata type and inherits its fullName field.

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.

Important

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

Field Name Description
childObjectMapping
Field Type
ObjectMapping
Description
Set of inputObject, mappingFields, and outputObject entries. For example, fields from the input object of OpportunityLineItem maps to fields of the output object of SalesAgreementProduct.
childObjectMappingId
Field Type
String
Description
The ID of the child object mapping record. This field is available in API version 56.0 and later.
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.
Valid values are:
  • 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
Description
Required.
Set of inputObject, mappingFields, and outputObject entries. For example, fields from the input object of Opportunity maps to fields of the output object of SalesAgreement.
parentObjectMappingId
Field Type
string
Description
The ID of the parent object mapping record. This field is available in API version 56.0 and later.
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.
sourceReferenceRelaFieldName
Field Type
string
Description
The field name in an object that's used to define the relationship between a source and reference object. This field is available in API version 56.0 and later.
usageType
Field Type
MappingUsageType (enumeration of type string)
Description
Required.
Name of the usage type of an object hierarchy relationship.
Valid value is:
  • ConvertToSalesAgreement
  • CLMFieldMapping
  • EligibleProgramRebateType
  • MapJournalToMemberAggregate
  • TransformationMapping

ObjectMapping

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

Fields

Field Name Description
inputObject
Field Type
string
Description
Required.
Name of the input object type containing the source fields for mapping. For example, Opportunity or OpportunityLineItem.
mappingFields
Field Type
ObjectMapping​Field
Description
Mapping of source object input fields to target object for SalesAgreement and SalesAgreementProduct.
outputObject
Field Type
string
Description
Required.
Name of the output object type receiving data conversion. For example, SalesAgreement or SalesAgreementProduct.

ObjectMappingField

Represents a set of inputField and outputField entries.

Fields

Field Name Description
inputField
Field Type
string
Description
Required.
Field in the object specified by the inputObject field in ObjectMapping. This field is mapped to the field in outputField, which is a field in the object specified by the outputObject field in ObjectMapping.
outputField
Field Type
string
Description
Required.
Field in the object specified by the outputObject field in 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.

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>Opportunity</inputObject>
    <mappingFields>
      <inputField>Name</inputField>
      <outputField>Name</outputField>
    </mappingFields>
    <mappingFields>
      <inputField>CloseDate</inputField>
      <outputField>StartDate</outputField>
    </mappingFields>
    <mappingFields>
      <inputField>Account</inputField>
      <outputField>Account</outputField>
    </mappingFields>
    <mappingFields>
      <inputField>Pricebook2</inputField>
      <outputField>Pricebook</outputField>
    </mappingFields>
    <outputObject>SalesAgreement</outputObject>
  </parentObjectMapping>

  <childObjectMapping>
    <inputObject>OpportunityLineItem</inputObject>
    <mappingFields>
      <inputField>Id</inputField>
      <outputField>Name</outputField>
    </mappingFields>
    <mappingFields>
      <inputField>UnitPrice</inputField>
      <outputField>SalesPrice</outputField>
    </mappingFields>
    <mappingFields>
      <inputField>PricebookEntry</inputField>
      <outputField>PricebookEntry</outputField>
    </mappingFields>
    <mappingFields>
      <inputField>Quantity</inputField>
      <outputField>InitialPlannedQuantity</outputField>
    </mappingFields>
    <outputObject>SalesAgreementProduct</outputObject>
  </childObjectMapping>

  <masterLabel>ObjectHierarchyRelationship</masterLabel>
  <usageType>ConvertToSalesAgreement</usageType>
  <parentRelationshipFieldName>Opportunity</parentRelationshipFieldName>
  <outputPntRelationshipFieldName>SalesAgreement</outputPntRelationshipFieldName>
  <parentRecord></parentRecord>
  <inputObjRecordsGrpFieldName>Account</inputObjRecordsGrpFieldName>
  <mappingType>ParentToParent</mappingType>

</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>51.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. For more information on the .zip file, deploying, and retrieving metadata, see Deploying and Retrieving Metadata with the Zip File. You can also deploy and retrieve the metadata API using Postman.

Ensure you map all the required fields for sales agreement conversion.

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.