Foundations Apex API Developer Reference

fferpcore.SimpleLinkingCorrelationStrategy

global with sharing virtual class SimpleLinkingCorrelationStrategy implements LinkingCorrelationStrategy

A fferpcore.SimpleLinkingCorrelationStrategy structure. This class will perform its database access without sharing.

This class implements the following interfaces:

Methods

SimpleLinkingCorrelationStrategy

global SimpleLinkingCorrelationStrategy(Schema.SObjectField correlationField)

The constructor for a SimpleLinkingCorrelationStrategy. This constructor is used to define the correlation field that is used to uniquely identify the SObject this subscriber is associated with.

Input Parameters

Name Type Description
correlationField Schema.SObjectField The field on the subscribing SObject that is entirely unique.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.LinkingCorrelationStrategy correlation = 
    new fferpcore.SimpleLinkingCorrelationStrategy(HCMFakeWorker__c.EmployeeId__c);

setCorrelationId

global void setCorrelationId(SObject record, String value)

This method sets the correlation field, which is defined in the constructor, on the given record to the specified value.

Input Parameters

Name Type Description
record SObject The SObject we want to assign the value to the correlation field.
value String The value we want the correlation field of the object to take.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.LinkingCorrelationStrategy correlation = 
    new fferpcore.SimpleLinkingCorrelationStrategy(HCMFakeWorker__c.EmployeeId__c);

SObject newRecord = HCMFakeWorker__c.SObjectType.newSObject(null, true);
m_correlation.setCorrelationId(newRecord, 'Foo');

selectItemsByCorrelationId

global virtual Map<String, SObject> selectItemsByCorrelationId(Schema.SObjectType objectType, Set<String> selectorFields, Set<String> correlationIds)

This method returns a list of all the SObjects of the specified type with the specified fields from a list of specified Ids. These Ids relate to the correlation field which is defined in the constructor.

Input Parameters

Name Type Description
objectType Schema.SObjectType The SObject type we want to get back.
selectorFields Set<String> A collection of the fields we want to get back.
correlationIds Set<String> A collection of Ids that we want to use to get objects back.

Return Value

This service returns a map of String, SObject objects.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.LinkingCorrelationStrategy correlation = 
    new fferpcore.SimpleLinkingCorrelationStrategy(HCMFakeWorker__c.EmployeeId__c);

Map<String, SObject> existingObjectsByCorrelationId = 
    correlation.selectItemsByCorrelationId(HCMFakeWorker.SObjectType, new Set<String>{'Name'}, new Set<String>{'Value'});
© Copyright 2009–2022 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.