Revenue Management API Developer Reference

ffrr.RetrieveAmountsRecognizedService

global with sharing class RetrieveAmountsRecognizedService implements Callable

Provides stateless methods related to Retrieving Recognized Amounts, implements the callable interface to support loose coupling between packages.

Methods

getRecognizedBetween

global static Map<Id, Map<Date, Decimal>> getRecognizedBetween(Set<Id> sourceIds, Date recognizedFrom, Date recognizedTo)

Provides the total amount recognized by recognition date between the recognizedFrom and recognizedTo dates inclusive.

Input Parameters

Name Type Description
sourceIds Set<Id> Source record Ids.
recognizedFrom Date Start date to search from.
recognizedTo Date End date to search to.

Return Value

Map of source Record Id with amount recognized per recognition date.

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.

//Arguments required to be passed into the method.
Set<Id> sourceRecordIds = new Set<Id>{'a1b000000000001AAA', 'a1b000000000001AAB'};
Date startDate = Date.newInstance(2019, 01, 01);
Date endDate = Date.newInstance(2019, 02, 01);

//Method call with params.
Map<Id, Map<Date, Decimal>> sourceRecordsIdByDate = ffrr.RetrieveAmountsRecognizedService.getRecognizedBetween(sourceRecordIds, startDate, endDate);

call

global Object call(String action, Map<String, Object> args)

Executes method supplied as action, with the arguments supplied in args.
valid Actions with arguments:
action: 'getRecognizedBetween' args: Map<String, Datetime> {'sourceIds'-> Set<Id> sourceRecordIds, 'recognizedFrom' -> Date.newInstance(2019, 01, 01), 'recognizedTo' - > Date.newInstance(2019, 02, 02)}

Input Parameters

Name Type Description
action String Method to be executed.
args Map<String, Object> Arguments required for method.

Return Value

Object containing method output.

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.

//Example usage of callable with the getRecognizedBetween method
//Name of service to call method on.
String extensionClass = 'ffrr.RetrieveAmountsRecognizedService';

//Name of method to call
String action = 'getRecognizedBetween';

//Arguments required for method to call.
Set<Id> sourceRecordIds = new Set<Id>{'a1b000000000001AAA', 'a1b000000000001AAB'};
Map<String, Object> arguments = new Map<String, Object>();
arguments.put('sourceIds', sourceRecordIds);
arguments.put('recognizedFrom', Date.newInstance(2019, 01, 01));
arguments.put('recognizedTo', Date.newInstance(2019, 02, 01));

//Create RetrieveAmountsRecognizedService to be able to invoke call.
Callable extension = (Callable) Type.forName(extensionClass).newInstance();

//Call the call method, passing in the method name to invoke, with the arguments required for the method.
Map<Id, Map<Date, Decimal>> sourceRecordsIdByDate = (Map<Id, Map<Date, Decimal>>)extension.call(action, arguments);
© Copyright 2009–2019 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.