Foundations Apex API Developer Reference

fferpcore.LookupTransformMapping

global class LookupTransformMapping implements TransformMapping

An implementation of a fferpcore.TransformMapping that populates a target field with a value from a related record.
Only compatible with an SObject target context.

This class implements the following interfaces:

Methods

LookupTransformMapping

global LookupTransformMapping(String sourceKey, String targetKey)

LookupTransformMapping

global LookupTransformMapping(List<String> sourceKeys, String targetKey)

Create a LookupTransformMapping.
The possible source and target keys are dictated by the source and target contexts, respectively.
For example, the fferpcore.Context.SObjectContext requires API names of SObject fields.

Input Parameters

Name Type Description
sourceKeys List<String> The list of keys that identify the fields that contain the source data.
targetKey String The key that identifies the destination field to populate.

Sample Data

List<String> sourceKeys: 'SomeSourceField1__c', 'SomeSourceField2__c'
String targetKey: 'SomeTargetField__c'

LookupTransformMapping

global LookupTransformMapping(List<List<String>> sourceKeys, String targetKey)

Create a LookupTransformMapping.
The possible source and target keys are dictated by the source and target contexts, respectively.
For example, the fferpcore.Context.SObjectContext requires API names of SObject fields.

Input Parameters

Name Type Description
sourceKeys List<List<String>> The list of key paths that identify the field paths that lead to the source data.
targetKey String The key that identifies the destination field to populate.

withLookupObject

global fferpcore.LookupTransformMapping withLookupObject(SObjectType lookupObject)

Specify the SObjectType that contains the record you want to locate. This is useful when the target field is not a lookup field.

Input Parameters

Name Type Description
lookupObject SObjectType The SObjectType of the lookup object.

Return Value

The instance of the LookupTransformMapping to enable fluent invocations.

withQueryFields

global fferpcore.LookupTransformMapping withQueryFields(List<SObjectField> queryFields)

Specify the field or fields on the lookup object to use to identify the record. By default, this is the name field. For records that do not contain unique names, specify an additional field to identify a single record.

Input Parameters

Name Type Description
queryFields List<SObjectField> A list of SObjectFields to query on the lookup object.

Return Value

The instance of the LookupTransformMapping to enable fluent invocations.

withResultField

global fferpcore.LookupTransformMapping withResultField(SObjectField resultField)

Specify the field on the located record that populates the target field. By default, this is the record ID.

Input Parameters

Name Type Description
resultField SObjectField A field on the lookup object that populates the target field.

Return Value

The instance of the LookupTransformMapping to enable fluent invocations.

getSourceKeys

global List<List<String>> getSourceKeys()

Return Value

The list of key paths that identify the field paths that lead to the source data.

getTargetKey

global String getTargetKey()

Return Value

The key that identifies the destination field to populate.

getLookupType

global SObjectType getLookupType()

Return Value

The SObjectType of the lookup object.

getQueryFields

global List<SObjectField> getQueryFields()

Return Value

A list of SObjectFields to query on the lookup object.

getResultField

global SObjectField getResultField()

Return Value

A field on the lookup object that populates the target field.

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