fferpcore.WithoutSharingDataSourceAdapterglobal with sharing class WithoutSharingDataSourceAdapter extends DataSource Decorate a fferpcore.DataSource via a Without Sharing class, to cause the DataSource's operations to be performed without sharing restrictions. This class extends fferpcore.DataSource Methods
WithoutSharingDataSourceAdapterglobal WithoutSharingDataSourceAdapter(fferpcore.DataSource targetDataSource) 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.DataSource withSharingDataSource = new fferpcore.TriggerDataSource(records); fferpcore.DataSource withoutSharingDataSource = new fferpcore.WithoutSharingDataSourceAdapter(withSharingDataSource); MessagingSystemService.deliverNow('Sample', 'Sample.Message.Type', withoutSharingDataSource); requireFieldglobal override void requireField(SObjectField field) Ask that this data source to query the given field. 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
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. // Given a datasource for Department__c, find the department name. departmentDataSource.requireField(Department__c.Name); requireLookupFieldglobal override fferpcore.DataSource requireLookupField(SObjectField field) Ask that this data source to 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. 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. // Given a Worker__c that has a Department__c, find the department name. fferpcore.DataSource departmentDataSource = workerDataSource.requireLookupField(Worker__c.Department__c); departmentDataSource.requireField(Department__c.Name); requireOneToManyFieldglobal override fferpcore.DataSource requireOneToManyField(BackReference backReference) Ask that this data source to query the given Master/Detail relationship. 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 lookup. 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. // Given a Deparment__c find the Employee payroll numbers. fferpcore.DataSource employeeDataSource = departmentDataSource.requireOneToManyField( new fferpcore.DataSource.BackReference(Worker__c.SObjectType, Worker__c.Department__c) ); employeeDataSource.requireField(Worker__c.PayrollNumber__c); runQueryglobal override Iterator<Row> runQuery() Load the data ignoring sharing restrictions. This must only be performed on the top level DataSource, not any of the DataSources returned by the requireLookupField or requireOneToManyField methods. This method will be called by the Declarative Publish framework. Return ValueAn iterator of fferpcore.DataSource.Row objects containing the required data. 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 class ExampleDataSource extends fferpcore.DataSource { private Set<SObjectField> m_fields; public ExampleDataSource() { } public override void requireField(SObjectField field) { m_fields.add(field); } public override Iterator<fferpcore.DataSource.Row> runQuery() { // Run SOQL to retrieve the data in m_fields } } ExampleDataSource source = new ExampleDataSource(); source.requireField(Account.Name); source.requireField(Account.AccountNumber); Iterator<fferpcore.DataSource.Row> rows = source.runQuery(); //use rows to construct a message |