fferpcore.LinkControlBodyHandlerglobal with sharing class LinkControlBodyHandler Methods
LinkControlBodyHandlerglobal LinkControlBodyHandler(Schema.SObjectType sourceObject, fferpcore.LinkingCorrelationStrategy correlation) This constructor is used to specify the object we want to amend the link control fields on and what kind of linking strategy to use. 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. /* * This handler is associated with the Resource.LinkControl message type */ global class HCMResourceLinkControlHandler implements fferpcore.MessageHandler { public void onMessages(fferpcore.HandleMessagesRequest request) { List<fferpcore.DeliveredMessage> messages = request.getMessages(); fferpcore.LinkControlBodyHandler linkControlBodyHandler = new fferpcore.LinkControlBodyHandler( HCMFakeWorker__c.SObjectType, new fferpcore.SimpleLinkingCorrelationStrategy(HCMFakeWorker__c.EmployeeId__c)); linkControlBodyHandler.onMessages(messages); } } withChildLinkControlglobal fferpcore.LinkControlBodyHandler withChildLinkControl(Id publicationId) Enable the population of child link control fields. Input Parameters
Return ValueThe instance of the LinkControlBodyHandler to enable fluent invocations. onMessagesglobal void onMessages(List<fferpcore.DeliveredMessage> messages) This method selects the link status fields on the sourceObject using fferpcore.LinkingCorrelationStrategy and fferpcore.LinkingFieldManager and applies the data from the LinkControl message. If no record exists for the correlation Id, the deliveries are marked in error. 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. public void handleLinkControlMessages( Schema.SObjectType sourceObject, fferpcore.LinkingCorrelationStrategy correlationStrategy, List<fferpcore.DeliveredMessage> messages) { fferpcore.LinkControlBodyHandler handler = new fferpcore.LinkControlBodyHandler(sourceObject, correlationStrategy); handler.onMessages(messages); } |