ObjectHierarchyRelationship
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 |
|
childObjectMappingId |
|
inputObjRecordsGrpFieldName |
|
mappingType |
|
masterLabel |
|
outputPntRelationshipFieldName |
|
parentObjectMapping |
|
parentObjectMappingId |
|
parentRecord |
|
parentRelationshipFieldName |
|
sourceReferenceRelaFieldName |
|
usageType |
|
Represents a set of inputObject, mappingFields, and outputObject entries.
Fields
Field Name | Description |
---|---|
inputObject |
|
mappingFields |
|
outputObject |
|
Represents a set of inputField and outputField entries.
Fields
Field Name | Description |
---|---|
inputField |
|
outputField |
|
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.