Foundations Object Model

ChildTransformMapping

global class ChildTransformMapping implements TransformMapping

An implementation of a TransformMapping that creates child records on the target object from child data on the source object.

This class implements the following interfaces:

Methods

ChildTransformMapping

global ChildTransformMapping(String sourceKey, String targetKey, ChildCorrelationStrategy correlationStrategy)

Create a ChildTransformMapping.
The possible source and target keys are dictated by the source and target contexts, respectively.
For example, the Context.SObjectContext requires names of SObject child relationships.

Input Parameters

Name Type Description
sourceKey String The key that identifies the relationship that contains the source child records.
targetKey String The key that identifies the destination relationship for which to create child records.
correlationStrategy ChildCorrelationStrategy The strategy that dictates how the child records are synchronized.

Sample Data

String sourceKey: 'SomeSourceRelationship__r'
String targetKey: 'SomeTargetRelationship__r'

ChildTransformMapping

global ChildTransformMapping(String targetKey, ChildCorrelationStrategy correlationStrategy)

Create a ChildTransformMapping.
This uses only the source parent record as the source data.
To create more than one target child record, use target child types.
The possible target keys are dictated by the target context.
For example, the Context.SObjectContext requires names of SObject child relationships.

Input Parameters

Name Type Description
targetKey String The key that identifies the destination relationship for which to create child records.
correlationStrategy ChildCorrelationStrategy The strategy that dictates how the child records are synchronized.

Sample Data

String targetKey: 'SomeTargetRelationship__r'

withMapping

global ChildTransformMapping withMapping(TransformMapping mapping)

Add a nested mapping to be processed on each child record in order to provide data to the created child records.

Input Parameters

Name Type Description
mapping TransformMapping The TransformMapping to be applied to each child record.

Return Value

The ChildTransformMapping instance to allow further method calls.

withMapping

global ChildTransformMapping withMapping(String targetChildType, TransformMapping mapping)

Add a nested mapping to be processed on each child record in order to provide data to the created child records.

Input Parameters

Name Type Description
targetChildType String The target child type for the mapping.
mapping TransformMapping The TransformMapping to be applied to each child record.

Return Value

The ChildTransformMapping instance to allow further method calls.

withFilter

global ChildTransformMapping withFilter(TransformFilter filter)

Provide a TransformFilter to filter the source child records.

Input Parameters

Name Type Description
filter TransformFilter An instance of a TransformFilter that defines the filter logic.

Return Value

The ChildTransformMapping instance to allow further method calls.

getSourceKey

global String getSourceKey()

Return Value

The key that identifies the relationship that contains the source child records.

getTargetKey

global String getTargetKey()

Return Value

The key that identifies the destination relationship for which to create child records.

getCorrelationStrategy

global ChildCorrelationStrategy getCorrelationStrategy()

Return Value

The strategy that dictates how the child records are synchronized.

getMappings

global Map<String, List<TransformMapping>> getMappings()

Return Value

A map containing lists of all the TransformMappings keyed on their target child type.

getFilter

global TransformFilter getFilter()

Return Value

An instance of a TransformFilter that defines the filter logic.

© Copyright 2009–2022 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.