Revenue Management API Developer Reference

ffrr.RevenueScheduleService

global with sharing class RevenueScheduleService

BETA Contains methods for Revenue Schedule operations.

Methods

generate

global static List<Id> generate(Set<Id> sourceRecordIds)

Disclaimer: Revenue Schedules are currently in development and not all use cases are supported (for full details refer to help). FinancialForce reserves the right to modify or remove the Revenue Schedules feature. There is no support for this feature while it is in development.

Takes a set of input source recordIds and generates and inserts multiple RevenueRecognitionSchedule__c and multiple associated RevenueRecognitionScheduleLine__c. The schedules and lines are populated with information from the source records, as defined by the associated Settings__c, using the calculation type from the associated Template__c.
Note: The appropriate Settings__c and Template__c must be set up for the source records, and the source record types.

Input Parameters

Name Type Description
sourceRecordIds Set<Id> Ids of the source records to generate the RevenueSchedule__c's from.

Return Value

The Ids of the created RevenueSchedule__c's

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 Schedule Service is used to create a Revenue Schedule for each
// source record Id passed in to the service method, and return a list of associated Revenue Schedule Ids

// Retrieve the Ids of the Performance obligations that will be used as the source Ids to generate Revenue Schedules
List<ffrr__PerformanceObligation__c> sourceRecords = [SELECT Id FROM ffrr__PerformanceObligation__c WHERE ffrr__AccountName__c = 'FF'];
Set<Id> sourceRecordIds = new Set<Id>();

for( ffrr__PerformanceObligation__c sourceRecord : sourceRecords )
{
    sourceRecordIds.add(sourceRecord.Id);
}

// Get the List of Revenue Schedule Ids that have been generated by this service
List<Id> revenueScheduleIds = ffrr.RevenueScheduleService.generate(sourceRecordIds);
© Copyright 2009–2020 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.