ffrr.RevenueRecognitionServiceglobal with sharing class RevenueRecognitionService Contains methods for Revenue Recognition operations. Methodsrecognizeglobal static Id recognize(ffrr.RevenueRecognitionService.RecognizeConfig config) Enqueues a batch apex job which recognizes revenue for all primary sobject types and all currencies. Input Parameters
Return ValueId to track progress of job. 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.
// In this example the Revenue Recognition Service is used to asynchronously create Recognition Transactions with associated lines for each
// source record type and revenue stream available and set up for revenue recognition.
// Configure the way revenue recognition should be performed.
ffrr.RevenueRecognitionService.RecognizeConfig config = new ffrr.RevenueRecognitionService.RecognizeConfig();
// Set the recognitionDate that the calculation will be based on.
config.recognitionDate = Date.today();
// Sets whether or not transactions are to be Committed.
config.shouldCommit = true;
// Sets the currency ISO codes the records should be recognized for. These must be valid Salesforce CurrencyIsoCodes.
config.currencyIsoCodes = new List<String>{ 'USD', 'GBP' };
// Calls recognition service.
ffrr.RevenueRecognitionService.recognize(config);
ffrr.RevenueRecognitionService.RecognizeConfigglobal inherited sharing class RecognizeConfig Class that contains the configuration required to successfully run the recognize process. 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 way revenue recognition should be performed.
ffrr.RevenueRecognitionService.RecognizeConfig config = new ffrr.RevenueRecognitionService.RecognizeConfig();
// Set the recognitionDate that the calculation will be based on.
config.recognitionDate = Date.today();
// Sets whether or not transactions are to be Committed.
config.shouldCommit = true;
// Sets the currency ISO codes the records should be recognized for. These must be valid Salesforce CurrencyIsoCodes.
config.currencyIsoCodes = new List<String>{ 'USD', 'GBP' };
Properties
MethodsRecognizeConfigglobal RecognizeConfig() |