Revenue Management API Developer Reference

ffrr.RevenueRecognitionService

global with sharing class RevenueRecognitionService

Contains methods for Revenue Recognition operations.

Methods

recognize

global 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

Name Type Description
config ffrr.RevenueRecognitionService.RecognizeConfig RecognizeConfig used to specify how the recognize process behaves.

Return Value

Id 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 Revenue 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.RecognizeConfig

global 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

Name Type Description
recognitionDate Date Date on which to base the calculation.
shouldCommit Boolean Whether or not transactions are to be Committed.
currencyIsoCodes List<String> The currency ISO codes the records should be recognized for. These must be valid Salesforce CurrencyIsoCodes.

Methods

RecognizeConfig

global RecognizeConfig()

© Copyright 2009–2022 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.