Foundations Object Model

SObjectDataTarget

global with sharing class SObjectDataTarget implements DataTargetRoot, DataTargetRoot2

Implementation of 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 SObjectDataTarget withSharingModel(SharingModel sharingModelValue)

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

Input Parameters

Name Type Description
sharingModelValue SharingModel With or without sharing.

Return Value

The same SObjectConsumer instance to allow further method calls.

withDryRun

global SObjectDataTarget withDryRun(Boolean dryRun)

Prevent the created SObjects being committed to the database. Existing SObjects may be read from the database. Results are available using the getSObjects method. No trigger validation will be run because no database writes are performed Therefore trigger and database level errors will not be 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 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.

requireField

global void requireField(String name, 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 DataTarget requireLookup(String name, Intent intent)

requireChildren

global DataTarget requireChildren(String name, Intent intent)

createWorkScope

global DataTargetWork createWorkScope()

queryByKeySet

global TargetObjectMap queryByKeySet(Set<Object> keySet)

queryByKeySetWithExternalCorrelation

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

queryByKeySetWithExternalCorrelations

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

hasAccess

global HasAccessResult hasAccess(List<String> targetPath)

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