Revenue Management API Developer Reference

ffrr.StagingService

global with sharing class StagingService

Used to create and delete Staging Summary and Staging Detail records.

Methods

create

global static ffrr.StagingService.CreateResult create(List<ffrr.StagingService.TabCreateContext> tabContexts, ffrr.StagingService.CreateOptions createOptions)

Create the Staging Records for the source records that match the filters in the tabs.

Input Parameters

Name Type Description
tabContexts List<ffrr.StagingService.TabCreateContext> Specifies the details required to create Staging Records for the Records that match the tab details.
createOptions ffrr.StagingService.CreateOptions Specifies additional data for the Transaction such as whether to run the process Synchronously or Asynchronously.

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.

// Create Staging Summary and Detail records using
// the ffrr.StagingService.TabCreateContext

// Create the tab
// This represents a group of primary recognition settings.
ffrr.ViewService.TabSelectorFilter tabSelectorFilter = new ffrr.ViewService.TabSelectorFilter();
tabSelectorFilter.field = Schema.Order.TotalAmount;
tabSelectorFilter.values = new List<Object>{100};

ffrr.ViewService.TabSelector tabSelector = new ffrr.ViewService.TabSelector();
tabSelector.objecttype = Order.SObjecttype;
tabSelector.filters = new List<ffrr.ViewService.TabSelectorFilter>{ tabSelectorFilter };

ffrr.ViewService.TabFilter tabFilter = new ffrr.ViewService.TabFilter();
tabFilter.recognitionDate = System.today();
tabFilter.currencyname = 'USD';

ffrr.ViewService.Tab tab = new ffrr.ViewService.Tab();
tab.objecttype = Order.sobjecttype;
tab.isActive = true;
tab.selectors = new List<ffrr.ViewService.TabSelector>{ tabSelector };
tab.tabFilter = tabFilter;

// Create the TabCreateContext
ffrr.StagingService.TabCreateContext context = new ffrr.StagingService.TabCreateContext();
context.Tab = tab;

// Optionally specify an existing version to update.
context.VersionId = [SELECT Id FROM ffrr__StagingVersion__c WHERE ffrr__GroupName__c = 'Order'][0].Id;

// Add TabCreateContext to the context list.
List<ffrr.StagingService.TabCreateContext> tabContexts = new List<ffrr.StagingService.TabCreateContext>();
tabContexts.add(context);

// Additional Configuration
// @see ffrr.StagingService.CreateOptions
ffrr.StagingService.CreateOptions options = new ffrr.StagingService.CreateOptions();
options.TransactionType = ffrr.CommonService.ApexTransactionType.SYNCHRONOUS;

// Create records.
ffrr.StagingService.create(tabContexts, options);

create

global static ffrr.StagingService.CreateResult create(List<ffrr.StagingService.RecordCreateContext> recordContexts, ffrr.StagingService.CreateOptions createOptions)

Create the Staging Records for the source records that match the provide RecordIds.

Input Parameters

Name Type Description
recordContexts List<ffrr.StagingService.RecordCreateContext> Specifies the details required to create Staging Records for the Specified RecordIDs.
createOptions ffrr.StagingService.CreateOptions Specifies additional data for the Transaction such as whether to run the process Synchronously or Asynchronously.

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.

// Create Staging Summary and Detail records using
// the ffrr.StagingService.RecordCreateContext

// Obtain IDs of source records.
Set<Id> ids = new Map<Id, Order>([SELECT Id FROM Order WHERE TotalAmount = 100]).keySet();

// Create RecordCreateContext to specify the records to create staging record for and the
// RecognitionDate to use in the calculations.
ffrr.StagingService.RecordCreateContext context = new ffrr.StagingService.RecordCreateContext();
context.RecordIds = new List<Id>(ids);
context.RecognitionDate = System.today();
context.CurrencyIsoCode = 'USD';

// Optionally specify an existing version to update.
context.VersionId = [SELECT Id FROM ffrr__StagingVersion__c WHERE ffrr__GroupName__c = 'Product'][0].Id;

// Add RecordCreateContext to the context list.
List<ffrr.StagingService.RecordCreateContext> recordContexts = new List<ffrr.StagingService.RecordCreateContext>();
recordContexts.add(context);

// Additional Configuration
// @see ffrr.StagingService.CreateOptions
ffrr.StagingService.CreateOptions options = new ffrr.StagingService.CreateOptions();
options.TransactionType = ffrr.CommonService.ApexTransactionType.SYNCHRONOUS;

// Create records.
ffrr.StagingService.create(recordContexts, options);

deleteRecords

global static ffrr.StagingService.DeleteResult deleteRecords(List<ffrr.StagingService.DeleteCriteria> criteria, ffrr.StagingService.DeleteOptions options)

Delete the staging data matching the criteria within the given context. Whether this is synchronous or asynchronous can be specified within the options.

Input Parameters

Name Type Description
criteria List<ffrr.StagingService.DeleteCriteria> Criteria to filter which records are deleted.
options ffrr.StagingService.DeleteOptions Additional configuration on how the delete will be performed.

Return Value

Delete result object.

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.

// Obtain the ID of a user.
Id userId = [SELECT Id FROM User WHERE FirstName = 'Peter'][0].Id;

// Create a new delete context.
ffrr.StagingService.DeleteOptions options = new ffrr.StagingService.DeleteOptions();

// Specify the desired transaction type.
options.TransactionType = ffrr.CommonService.ApexTransactionType.Dynamic;

// Create criteria for the user.
ffrr.StagingService.DeleteCriteria criteria = new ffrr.StagingService.DeleteCriteria();
criteria.Users = new List<Id>{userId};

List<ffrr.StagingService.DeleteCriteria> criteriaList = new List<ffrr.StagingService.DeleteCriteria>{criteria};

// Invoke the method.
ffrr.StagingService.deleteRecords(criteriaList, options);

retrieve

global static Map<Id, ffrr.StagingService.RetrieveResult> retrieve(ffrr.StagingService.RetrieveContext context)

Retrieve the Staging data matching the criteria within the given context. Retrieves the Summary and Detail records under the specified Summaries in the context

Input Parameters

Name Type Description
context ffrr.StagingService.RetrieveContext Specifies the criteria for data to be retrieved

Return Value

A map of RetrieveResults keyed by the Summary Id that was expanded.

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.

// Create tabselector
ffrr.ViewService.TabSelector tabSelector = new ffrr.ViewService.TabSelector();
tabSelector.objecttype = ffrr__settingsTestObject__c.SObjecttype;
tabSelector.filters = new List<ffrr.ViewService.TabSelectorFilter>();

// Create and populate tabfilter
ffrr.ViewService.TabFilter tabFilter = new ffrr.ViewService.TabFilter();
tabFilter.recognitionDate = System.today();
tabFilter.currencyname = 'USD';

// Create and populate tab to provide filtering
// See ffrr.ViewService.Tab for more options
ffrr.ViewService.Tab tab = new ffrr.ViewService.Tab();
tab.objecttype = ffrr__settingsTestObject__c.SObjecttype;
tab.tabFilter = tabFilter;

// Create blank context
ffrr.StagingService.RetrieveContext retrieveContext = new ffrr.StagingService.RetrieveContext();

// Set List<Id> Summaries (The summaries to be expanded)
// If the list remains null, the root summary and summaries/details related to it will be retrieved.
// Otherwise all the related summaries and details under the specified summaries will be retrieved.
retrieveContext.Summaries = new List<Id>{[SELECT Id FROM ffrr__StagingSummary__c WHERE ffrr__StagingSummary__c = null LIMIT 1].Id};
retrieveContext.Tab = tab;

// Specify the grouping Id to retrieve only Staging
// Summary and Detail records related to it.
Id grouping = [SELECT Id FROM ffrr__GroupingSummary__c LIMIT 1].Id;
retrieveContext.GroupingRecordId = grouping;

// Call retrieve Method
// Summaries and details from a result can be accessed with retrieveResult.summaries and retrieveResult.details
// The root summary (if retrieved) can be accessed with retrieveResult.Root
Map<Id, ffrr.StagingService.RetrieveResult> retrieveResult = ffrr.StagingService.retrieve(retrieveContext);

ffrr.StagingService.CreateContext

global abstract with sharing class CreateContext

Contains information required to create staging records.

Properties

Name Type Description
GroupingCriteria List<ffrr.GroupingService.GroupingCriteria> The list of GroupingService.GroupingCriteria used to populate the grouping fields on the staging objects.
VersionId Id The ID of an existing version to assign new summaries and details to.

ffrr.StagingService.CreateOptions

global with sharing class CreateOptions

Class which contains the transaction and record type that are to be used in a context. @param TransactionType The type of transaction represented in this context

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.

// Configure the Apex Transaction type that will be performed
// when creating the Staging Summary and Staging Detail records.
ffrr.StagingService.CreateOptions options = new ffrr.StagingService.CreateOptions();

// Set the apex transaction type that will be performed (Synchronous, Asynchronous or Dynamic).
options.TransactionType = ffrr.CommonService.ApexTransactionType.SYNCHRONOUS;

// Controls whether the create staging process will run for standard Revenue Recognition
// or for Parallel and Retrospective Reporting. If set to true, source records that are
// related to recognition settings where the Use in Revenue Contract value is true will be selected.
// Note: The default value for this property is false.
options.ProcessUseInContractRecords = true;

Properties

Name Type Description
ProcessUseInContractRecords Boolean Specifies whether to only process source records that relate to recognition settings where ffrr__UseInRevenueContract__c is true, this can be used for parallel reporting. If set to false only records related to recognition settings where ffrr__UseInRevenueContract__c is false will be processed. The default is false.
TransactionType ffrr.CommonService.ApexTransactionType The type of transaction represented in this context.

Methods

CreateOptions

global CreateOptions()

Specify if the last delete date custom setting is going to be used when deleting staging data.

ffrr.StagingService.CreateResult

global with sharing class CreateResult

Container for data resulting from a create operation.

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.

// Obtain IDs of some source records.
Set<Id> recordIds = new Map<Id, Product2>([SELECT Id FROM Product2 WHERE ProductCode = 'ML2']).keySet();

// Create context.
ffrr.StagingService.RecordCreateContext context = new ffrr.StagingService.RecordCreateContext();
context.RecordIds = new List<Id>(recordIds);
context.RecognitionDate = System.today();
context.CurrencyIsoCode = 'USD';

// Create list of contexts.
List<ffrr.StagingService.RecordCreateContext> contexts = new List<ffrr.StagingService.RecordCreateContext>{context};

// Specify options.
ffrr.StagingService.CreateOptions options = new ffrr.StagingService.CreateOptions();
options.TransactionType = ffrr.CommonService.ApexTransactionType.ASYNCHRONOUS;

// Create staging records while assigning the result object.
ffrr.StagingService.CreateResult result = ffrr.StagingService.create(contexts, options);

// Obtain ID of batch job.
Id createBatchId = result.BatchId;

// Obtain list of new version IDs.
List<Id> newVersionIds = result.VersionIds;

// Obtain list of any record IDs that did not have a parent and so could not be processed.
List<Id> orphanIds = result.OrphanIds;

Properties

Name Type Description
BatchId Id ID of a batch job if one was created.
OrphanIds List<Id> IDs of records that could not be processed as they have no parent record.
VersionIds List<Id> IDs of created versions.

Methods

CreateResult

global CreateResult()

ffrr.StagingService.DeleteCriteria

global with sharing class DeleteCriteria

Criteria to filter which records are deleted within a delete operation.

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.

// Obtain the ID of a user.
Id userId = [SELECT Id FROM User WHERE FirstName = 'Peter' LIMIT 1].Id;

// Create criteria for the user.
ffrr.StagingService.DeleteCriteria criteria = new ffrr.StagingService.DeleteCriteria();
criteria.Users = new List<Id>{userId};

// Specify the Versions which should be deleted.
ffrr__StagingVersion__c version = [SELECT Id FROM ffrr__StagingVersion__c LIMIT 1];
criteria.Versions = new List<Id>{ version.Id };

// Specify if Versions with IsLatest__c = true should not be deleted.
criteria.KeepLatestVersions = true;

// Specify if the Last Delete Date custom setting should be used to restrict what data is deleted.
criteria.UpdateLastDeleteDate = true;

// Criteria is inclusive, so only records that match ALL Criteria specified will be deleted.
// For example, specifying KeepLatestVersions = true and a Version Id of a Version
// where IsLatest__c = true will result in no records being deleted.

Properties

Name Type Description
Users List<Id> Ids of the specific users who's staging data should be deleted.
Versions List<Id> Ids of the versions that should be deleted.
KeepLatestVersions Boolean Should the latest versions be deleted?
UpdateLastDeleteDate Boolean Updates the Last Delete value on the Staging Settings to the date and time the delete operation run.

Methods

DeleteCriteria

global DeleteCriteria()

ffrr.StagingService.DeleteOptions

global with sharing class DeleteOptions

Options to influence how a delete operation is performed.

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.

// Create new delete options.
ffrr.StagingService.DeleteOptions options = new ffrr.StagingService.DeleteOptions();

// Specify the desired transaction type.
options.TransactionType = ffrr.CommonService.ApexTransactionType.ASYNCHRONOUS;

Properties

Name Type Description
TransactionType ffrr.CommonService.ApexTransactionType How the transaction should be executed.

Methods

DeleteOptions

global DeleteOptions()

ffrr.StagingService.DeleteResult

global with sharing class DeleteResult

Container for data resulting from a delete operation.

Properties

Name Type Description
BatchId Id Id of a batch job if one was created.

Methods

DeleteResult

global DeleteResult()

ffrr.StagingService.Detail

global with sharing class Detail extends StagingRecord

This class extends ffrr.StagingService.StagingRecord

Properties

Name Type Description
Amended Boolean A detail record is amended when the ToRecognizeThisPeriod is different from the OriginalToRecognizeThisPeriod value, which is set at record creation.
AmendedCost Boolean A detail record is amended-cost when the ToAmortizeThisPeriod is different from the OriginalToAmortizeThisPeriod value, which is set at record creation.
OriginalToAmortizeThisPeriod Decimal The original "toAmortizeThisPeriod" value that was calculated for this record. It is used if the value of toAmortizeThisPeriod has been changed/amended.
OriginalToRecognizeThisPeriod Decimal The original "toRecognizeThisPeriod" value that was calculated for this record. It is used if the value of toRecognizeThisPeriod has been changed/amended.
Summary Id The Id of the summary to which this detail record is attached
Template ffrr.ViewService.Reference The Reference to the source record's Template used to calculate revenue
TotalCost Decimal The Total Cost used in Calculations for this record
TotalRevenue Decimal The Total Revenue used in Calculations for this record
ToAmortizeThisPeriod Decimal The To Amortize amount calculated for this record
ToRecognizeThisPeriod Decimal The To Recognize amount calculated for this record
PreviouslyAmortized Decimal The Previously Amortized amount for this record
PreviouslyRecognized Decimal The Previously Recognized amount for this record
IsLeaf Boolean A detail record is a leaf when there are no other source records, with templates, related to it in a lower level.

Methods

Detail

global Detail()

ffrr.StagingService.RecordCreateContext

global with sharing class RecordCreateContext extends CreateContext

Contains details required to create Staging records from Records.

This class extends ffrr.StagingService.CreateContext

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.

// Create a new RecordCreateContext to specify which records
// will be used to create Staging Summary and Staging Detail records
// for a specific Recognition Date
ffrr.StagingService.RecordCreateContext context = new ffrr.StagingService.RecordCreateContext();

// Optionally set up the groupings
List<Schema.SObjectField> objectFields = new List<Schema.SObjectField>();
objectFields.add( Account.Rating );
ffrr.GroupingService.GroupingCriteria criteria = new ffrr.GroupingService.GroupingCriteria( 1, Account.getSObjectType(), objectFields );

// Set the recordIds property
Set<Id> ids = new Map<Id, Order>([SELECT Id FROM Order WHERE TotalAmount = 100]).keySet();
context.RecordIds = new List<Id>( ids );

// Set the Recognition Date property
context.RecognitionDate = System.today();

// Set the Currency Property
context.CurrencyIsoCode = 'GBP';

// Set the Groupings
context.GroupingCriteria = new List<ffrr.GroupingService.GroupingCriteria>{criteria};

Properties

Name Type Description
RecordIds List<Id> The Ids of the records for which to create StagingRecords.
CurrencyIsoCode String The Currency to filter the provided RecordIds on.
RecognitionDate Date The Date used when performing the calculations. This is based on the associated Templates.

Methods

RecordCreateContext

global RecordCreateContext()

ffrr.StagingService.RetrieveContext

global with sharing class RetrieveContext

Configuration regarding the retrieve operation.

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.

// Create the configuration for retrieving records from the database
ffrr.StagingService.RetrieveContext context = new ffrr.StagingService.RetrieveContext();

// Set List<Id> of summaries
// These are the Ids of the summaries to be expanded.
// If the list is set to null the root summary of the latest version will be expanded
// and the root summary will be included in the ffrr.StagingService.RetrieveResult
context.Summaries = null;

//Setup the filters
ffrr.ViewService.TabSelectorFilter tabSelectorFilter = new ffrr.ViewService.TabSelectorFilter();
tabSelectorFilter.field = Schema.Order.TotalAmount;
tabSelectorFilter.values = new List<Object>{100};

ffrr.ViewService.TabSelector tabSelector = new ffrr.ViewService.TabSelector();
tabSelector.objecttype = Order.SObjecttype;
tabSelector.filters = new List<ffrr.ViewService.TabSelectorFilter>{ tabSelectorFilter };

// Set any filters to be applied
// See ffrr.ViewService.Tab example for more options.
ffrr.ViewService.TabFilter tabFilter = new ffrr.ViewService.TabFilter();
tabFilter.recognitionDate = System.today();
tabFilter.currencyname = 'USD';

ffrr.ViewService.Tab tab = new ffrr.ViewService.Tab();
tab.objecttype = ffrr__SettingsTestObject__c.SObjecttype;
tab.isActive = true;
tab.selectors = new List<ffrr.ViewService.TabSelector>{ tabSelector };
tab.tabFilter = tabFilter;

context.Tab = tab;

// Optionally specify a Grouping Summary Id, to
// retrieve only the related Staging Summary and Detail records.
Id grouping = [SELECT Id FROM ffrr__GroupingSummary__c LIMIT 1].Id;
context.GroupingRecordId = grouping;

Properties

Name Type Description
GroupingRecordId Id Only Staging Summary and Detail records that relate to the root Summary and provided Grouping Summary will be returned. The values in the Root Summary will match the values in the supplied Grouping Summary. Some values that are not in the Grouping Summary will be left null.
Summaries List<Id> The ids of the Summaries to expand. For null value the root summary of the version specified will be expanded.
Tab ffrr.ViewService.Tab Tab is used to retrieve the staging records under the root summary if no summary ids are specified. The root summary retrieved is the summary of the latest version for the Group Name provided in the Tab.

Methods

RetrieveContext

global RetrieveContext()

The version that will be retrieved (Optional) If version is not provided and summaries is null the latest version will be retrieved.

ffrr.StagingService.RetrieveResult

global with sharing class RetrieveResult

Contains the data resulting from a Retrieve Operation

Properties

Name Type Description
Details List<ffrr.StagingService.Detail> A list of all details below the given summary
Summaries List<ffrr.StagingService.Summary> List of Summaries below the given summary

Methods

RetrieveResult

global RetrieveResult()

ffrr.StagingService.StagingRecord

global virtual with sharing class StagingRecord

Base class containing generic information for a Staging Record.

Properties

Name Type Description
Id Id The Id of the Staging Record
Account ffrr.ViewService.Reference The Account Id and/or Account Name related to the staging record
OriginalRecord Id The Id of the Original Source Record. In the case that the staging record is created from an Opportunity Line Item Mirror this is the Id of the Opportunity Line Item that the mirror item was created from.
SourceRecord Id The Id of the source record used to create the staging record
SourceRecordName String The Name of the source record used to create the staging record
Version Id The version associated with this record
Error String Any errors related to this record

Methods

StagingRecord

global StagingRecord()

ffrr.StagingService.Summary

global with sharing class Summary extends StagingRecord

This class extends ffrr.StagingService.StagingRecord

Properties

Name Type Description
ParentSummary Id The Id of the record's parent Summary
AmendedCostDetailCount Integer The number of the detail records (both leaf and parent) directly under this summary that have had ToAmortizeThisPeriod modified
AmendedCostLeafCount Integer The number of the leaf detail records directly under this summary that have had ToAmortizeThisPeriod modified
AmendedDetailCount Integer The number of the detail records (both leaf and parent) directly under this summary that have had ToRecognizeThisPeriod modified
AmendedLeafCount Integer The number of the leaf detail records directly under this summary that have had ToRecognizeThisPeriod modified
TotalAmendedCostDetailCount Integer The number of the detail records (both leaf and parent) at any level under this summary that have had ToAmortizeThisPeriod modified
TotalAmendedCostLeafCount Integer The number of leaf detail records at any level under this summary that have had ToAmortizeThisPeriod modified
TotalAmendedDetailCount Integer The number of the detail records (both leaf and parent) at any level under this summary that have had ToRecognizeThisPeriod modified
TotalAmendedLeafCount Integer The number of leaf detail records at any level under this summary that have had ToRecognizeThisPeriod modified
TotalDetailCount Integer The number of the detail records (both leaf and parent) that are at any level under this summary
TotalLeafCount Integer The number of leaf detail records that are at any level under this summary
DetailCount Integer The number of the detail records (both leaf and parent) directly under this summary
LeafCount Integer The number of the leaf detail records directly under this summary
TotalDetailErrorCount Integer The number of the detail records (both leaf and parent) at any level under this summary that are in error
TotalLeafErrorCount Integer The number of leaf detail records at any level below this summary that are in error
DetailErrorCount Integer The number of the detail records (both leaf and parent) directly under this summary that are in error
LeafErrorCount Integer The number of leaf detail records directly under this summary that are in error
TotalDetailCost Decimal The summed Total Cost value of the details (leaf and parent) at any level under this summary
TotalLeafCost Decimal The summed Total Cost value of the leaf details at any level under this summary
DetailCost Decimal The summed Total Cost value of the details (leaf and parent) directly under this summary
LeafCost Decimal The summed Total Cost value of the leaf details directly under this summary
TotalDetailRevenue Decimal The summed Total Revenue value of the details (leaf and parent) at any level under this summary
TotalLeafRevenue Decimal The summed Total Revenue value of the leaf details at any level under this summary
DetailRevenue Decimal The summed Total Revenue value of the details (leaf and parent) directly under this summary
LeafRevenue Decimal The summed Total Revenue value of the leaf details directly under this summary
TotalDetailToAmortizeThisPeriod Decimal The total To Amortize amount of the details (leaf and parent) at any level under this summary
TotalLeafToAmortizeThisPeriod Decimal The total To Amortize amount of the leaf details at any level under this summary
DetailToAmortizeThisPeriod Decimal The total To Amortize amount of the details (leaf and parent) directly under this summary
LeafToAmortizeThisPeriod Decimal The total To Amortize amount of the leaf details directly under this summary
TotalDetailToRecognizeThisPeriod Decimal The total To Recognize amount of the details (leaf and parent) at any level under this summary
TotalLeafToRecognizeThisPeriod Decimal The total To Recognize amount of the leaf details at any level under this summary
DetailToRecognizeThisPeriod Decimal The total To Recognize amount of the details (leaf and parent) directly under this summary
LeafToRecognizeThisPeriod Decimal The total To Recognize amount of the leaf details directly under this summary
TotalDetailPreviouslyAmortized Decimal The total Previously Amortized amount of the details (leaf and parent) at any level under this summary
TotalLeafPreviouslyAmortized Decimal The total Previously Amortized amount of the leaf details at any level under this summary
DetailPreviouslyAmortized Decimal The total Previously Amortized amount of the details (leaf and parent) directly under this summary
LeafPreviouslyAmortized Decimal The total Previously Amortized amount of the leaf details directly under this summary
TotalDetailPreviouslyRecognized Decimal The total Previously Recognized amount of the details (leaf and parent) at any level under this summary
TotalLeafPreviouslyRecognized Decimal The total Previously Recognized amount of the leaf details at any level under this summary
DetailPreviouslyRecognized Decimal The total Previously Recognized amount of the details (leaf and parent) directly under this summary
LeafPreviouslyRecognized Decimal The total Previously Recognized amount of the leaf details directly under this summary

Methods

Summary

global Summary()

ffrr.StagingService.TabCreateContext

global with sharing class TabCreateContext extends CreateContext

Contains details required to create Staging records based on a Tab.

This class extends ffrr.StagingService.CreateContext

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.

// Create new TabCreateContext to configure wich records will be used
// to create the Staging Summary and Staging Detail records.
//
// The filter criteria specified in the ViewService.Tab will be used to
// retrieve the records that will be used from the Staging Service
ffrr.StagingService.TabCreateContext context = new ffrr.StagingService.TabCreateContext();

//Setup the filters
ffrr.ViewService.TabSelectorFilter tabSelectorFilter = new ffrr.ViewService.TabSelectorFilter();
tabSelectorFilter.field = Schema.Order.TotalAmount;
tabSelectorFilter.values = new List<Object>{100};

ffrr.ViewService.TabSelector tabSelector = new ffrr.ViewService.TabSelector();
tabSelector.objecttype = Order.SObjecttype;
tabSelector.filters = new List<ffrr.ViewService.TabSelectorFilter>{ tabSelectorFilter };

ffrr.ViewService.TabFilter tabFilter = new ffrr.ViewService.TabFilter();
tabFilter.recognitionDate = System.today();
tabFilter.currencyname = 'USD';

ffrr.ViewService.Tab tab = new ffrr.ViewService.Tab();
tab.objecttype = Order.sobjecttype;
tab.isActive = true;
tab.selectors = new List<ffrr.ViewService.TabSelector>{ tabSelector };
tab.tabFilter = tabFilter;

// Optionally set up the groupings
List<Schema.SObjectField> objectFields = new List<Schema.SObjectField>();
objectFields.add( Account.Rating );
ffrr.GroupingService.GroupingCriteria criteria = new ffrr.GroupingService.GroupingCriteria( 1, Account.getSobjecttype(), objectFields );

// Set the filters to the context
context.Tab = tab;

// Set the criteria to the context
context.GroupingCriteria = new List<ffrr.GroupingService.GroupingCriteria>{criteria};

Properties

Name Type Description
Tab ffrr.ViewService.Tab The Tab which contains the filters that will be applied to select the source records based on which the staging records will be created.

Methods

TabCreateContext

global TabCreateContext()

TabCreateContext

global TabCreateContext(ffrr.ViewService.Tab Tab)

© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.