fferpcore.LinkingCorrelationStrategyglobal interface LinkingCorrelationStrategy The purpose of this interface is to link multiple SObjects together when messages are sent. This could be done when creating an SObject on product A, product B receives this message and creates a similar SObject on product B. All methods in this interface must be implemented in order to use them. Methods
setCorrelationIdvoid 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
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'); selectItemsByCorrelationIdMap<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
Return ValueThis 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'}); |