fferpcore.TriggerDataSourceglobal with sharing class TriggerDataSource extends DataSource This fferpcore.DataSource is for use in triggers and is invoked with the list of fully populated records from the trigger. The runQuery() method returns an iterator that steps through all records passed in from the trigger. Consequently it does not provide an implementation of the requireField method. This class extends fferpcore.DataSource Methods
TriggerDataSourceglobal TriggerDataSource(List<SObject> records) 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 example uses the Message Description and Declarative Extension system to send messages * about updates to the Sample__c custom object. It is assumed that the publishing product * 'SampleProduct' is registered to send messages to the 'Sample.Update' Message Type. */ trigger SampleTrigger on Sample__c (after insert, after update) { // Prevent an infinite loop by not sending a message in response to a message. if (!fferpcore.MessagingSystemService.isInDelivery()) { // Provide the new or updated records as a DataSource for message generation. fferpcore.DataSource dataSource = new fferpcore.TriggerDataSource(Trigger.New); // Send the messages fferpcore.MessagingSystemService.deliverLater('SampleProduct', 'Sample.Update', dataSource); } } requireLookupFieldglobal override fferpcore.DataSource requireLookupField(SObjectField field) Ask that this data source query the given lookup. This method will be called by the Declarative Publish framework or by custom message Nodes during the preparation phase of declarative message building. Input Parameters
Return ValueA DataSource representing the target of the look up. requireOneToManyFieldglobal virtual override fferpcore.DataSource requireOneToManyField(BackReference backReference) Implementation of DataSource.requireOneToManyField(). Input Parameters
Return ValueA DataSource representing the target of the lookup. runQueryglobal override Iterator<fferpcore.DataSource.Row> runQuery() Implementation of DataSource.runQuery(). Return ValueAn iterator of fferpcore.DataSource.Row objects containing the required data. |