Foundations Apex API Developer Reference

fferpcore.SObjectDataTarget

global with sharing class SObjectDataTarget implements DataTargetRoot, DataTargetRoot2

Implementation of fferpcore.DataTargetRoot for a given SObjectType in the database.

This class implements the following interfaces:

Methods

SObjectDataTarget

global SObjectDataTarget(SObjectType objectType, String correlationField)

Construct an SObjectDataTarget.

Input Parameters

Name Type Description
objectType SObjectType The SObjectType to update and create records on.
correlationField String The field API name used to identify SObjects.

SObjectDataTarget

global SObjectDataTarget(SObjectType objectType, List<String> correlationFields)

Construct an SObjectDataTarget.

Input Parameters

Name Type Description
objectType SObjectType The SObjectType to update and create records on.
correlationFields List<String> The field API names used to identify SObjects.

withSharingModel

global fferpcore.SObjectDataTarget withSharingModel(fferpcore.SharingModel sharingModelValue)

Specify the sharing model to use when querying the database for existing records.

Input Parameters

Name Type Description
sharingModelValue fferpcore.SharingModel With or without sharing.

Return Value

The same SObjectConsumer instance to allow further method calls.

withDryRun

global fferpcore.SObjectDataTarget withDryRun(Boolean dryRun)

Prevent the created SObjects from being committed to the database.
Existing SObjects can be read from the database.
Results are available using the getCaptureResult method.
No trigger validation is run because no database writes are performed, meaning trigger and database level errors are not detected.

Input Parameters

Name Type Description
dryRun Boolean True to prevent committing to the database.

Return Value

The same SObjectDataTarget instance to allow further method calls.

withMaximumChildCount

global fferpcore.SObjectDataTarget withMaximumChildCount(Integer maxChildCount, String childCountField)

Specify the maximum number of child records that each parent target record can have.
If multiple external correlation keys are provided and this child record count is exceeded, an additional parent target record will be created.

Input Parameters

Name Type Description
maxChildCount Integer The maximum number of child records each parent target record can have.
childCountField String The API name of a field on the target object containing the number of child records.

Return Value

The same SObjectDataTarget instance to allow further method calls.

getCaptureResult

global fferpcore.SObjectDataTarget.CaptureResult getCaptureResult()

Access the captured data from the previously completed work scope.
This is especially useful when using withDryRun to prevent committing target records to the database.

Return Value

Captured data from the previously completed work scope.

requireField

global void requireField(String name, fferpcore.Intent intent)

Missing keys will be reported as errors in commit results and virtual data object events. This is used when data is required for reading, for example as a virtual data object. Use cases that create missing records will leave this unset.

Return Value

This SObjectDataTarget for chaining.

requireLookup

global fferpcore.DataTarget requireLookup(String name, fferpcore.Intent intent)

requireChildren

global fferpcore.DataTarget requireChildren(String name, fferpcore.Intent intent)

createWorkScope

global fferpcore.DataTargetWork createWorkScope()

queryByKeySet

global fferpcore.TargetObjectMap queryByKeySet(Set<Object> keySet)

queryByKeySetWithExternalCorrelation

global fferpcore.TargetObjectMap queryByKeySetWithExternalCorrelation(Map<Object, Object> correlationKeysBySearchValue)

queryByKeySetWithExternalCorrelations

global fferpcore.TargetObjectMap queryByKeySetWithExternalCorrelations(Map<List<Object> , List<Object>> correlationKeysBySearchValues)

hasAccess

global fferpcore.HasAccessResult hasAccess(List<String> targetPath)

fferpcore.SObjectDataTarget.CaptureResult

global interface CaptureResult

Data captured from a completed work scope.

Methods

getRecordsByCorrelationId

Map<Object, SObjectTarget> getRecordsByCorrelationId()

Return Value

Created or updated target objects keyed by their correlation ID.

© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.