global static List<Id> generate(Set<Id> sourceRecordIds)
Takes a set of input source recordIds and generates and inserts multiple ffrr__RevenueRecognitionSchedule__c and multiple associated ffrr__RevenueRecognitionScheduleLine__c. The schedules and lines are populated with information from the source records, as defined by the associated ffrr__Settings__c, using the calculation type from the associated ffrr__Template__c. Note: The appropriate ffrr__Settings__c and ffrr__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 ffrr__RevenueSchedule__c records from.
Return Value
The Ids of the created ffrr__RevenueSchedule__c records.
Sample Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//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
// If any of the sources are not set up for revenue recognition then no schedules will be generated.
// Retrieve the Ids of the Performance Obligations that will be used as the source Ids from which to generate Revenue Schedules
List<ffrr__PerformanceObligation__c> sourceRecords = [SELECT Id FROM ffrr__PerformanceObligation__c WHERE ffrr__AccountName__c = 'FF'];
global static Map<Id, ffrr.RevenueScheduleService.GenerateResult> generate(Set<Id> sourceRecordIds, ffrr.RevenueScheduleService.GenerateConfig config)
Takes a set of input source recordIds and a configuration and generates and inserts multiple ffrr__RevenueRecognitionSchedule__c and multiple associated ffrr__RevenueRecognitionScheduleLine__c. The schedules and lines are populated with information from the source records, as defined by the associated ffrr__Settings__c, using the calculation type from the associated ffrr__Template__c. Note: The appropriate ffrr__Settings__c and ffrr__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 ffrr__RevenueSchedule__c records from.
Generates and inserts multiple ffrr__RevenueRecognitionSchedule__c and multiple associated ffrr__RevenueRecognitionScheduleLine__c asynchronously for all the valid objects available in the Org. The schedules and lines are populated with information from the source records, as defined by the associated ffrr__Settings__c, using the calculation type from the associated ffrr__Template__c. Note: The appropriate ffrr__Settings__c and ffrr__Template__c must be set up for the source records, and the source record types.
Return Value
Id of the executing fferpcore__ProcessRun__c record.
Sample Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//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 asynchronously create a Revenue Schedule for each
// available source record in the org, and return the Async Apex Job Id.
// If a source is not set up for revenue recognition then no schedules will be generated for it.
// If a source is set up for revenue recognition then a schedule will be generated for it.
// Get the Id of Async Apex Job generating the Revenue Schedules
Id batchJobId = ffrr.RevenueScheduleService.generateAsync();
// Get AsyncApexJob status
List<AsyncApexJob> batchJob = [SELECT Id, Status FROM AsyncApexJob WHERE Id = :batchJobId];
global static Id generateAsync(Set<Id> sourceRecordIds)
Takes a set of input source recordIds and generates and inserts multiple ffrr__RevenueRecognitionSchedule__c and multiple associated ffrr__RevenueRecognitionScheduleLine__c asynchronously. The schedules and lines are populated with information from the source records, as defined by the associated ffrr__Settings__c, using the calculation type from the associated ffrr__Template__c. Note: The appropriate ffrr__Settings__c and ffrr__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 ffrr__RevenueSchedule__c records from.
Return Value
Id of the executing fferpcore__ProcessRun__c record.
Sample Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//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 asynchronously create a Revenue Schedule for each
// source record Id passed in to the service method, and return the Async Apex Job Id.
// If a source is not set up for revenue recognition then no schedules will be generated for it.
// If a source is set up for revenue recognition then a schedule will be generated for it.
// Retrieve the Ids of the Performance Obligations that will be used as the source Ids from which to generate Revenue Schedules
List<ffrr__PerformanceObligation__c> sourceRecords = [SELECT Id FROM ffrr__PerformanceObligation__c WHERE ffrr__AccountName__c = 'FF'];
global static ffrr.RevenueScheduleService.RecognizeResult recognize(Set<Id> revenueScheduleLineIds, ffrr.RevenueScheduleService.RecognitionInformation recognitionInformation)
Recognizes revenue for the given revenue schedule lines.
Input Parameters
Name
Type
Description
revenueScheduleLineIds
Set<Id>
Set<Id> of the revenue schedule lines from which to recognize revenue.
Sample Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//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 Recognition Transaction for each
// Revenue Schedule Line Id passed in to the service method.
// The recognize method is called with a RecognitionInformation object that sets the recognition date.
// Retrieve the Ids of the Revenue Schedule Lines that will be used to create Revenue Recognition Transactions from.
Map<Id, ffrr__RevenueScheduleLine__c> scheduleLinesByIds = newMap<Id, ffrr__RevenueScheduleLine__c>([SELECT Id, Name FROM ffrr__RevenueScheduleLine__c]);
global static Id recognizeAsync(ffrr.RevenueScheduleService.RecognitionFilters recognitionFilters, ffrr.RevenueScheduleService.RecognitionInformation recognitionInformation)
Recognizes all revenue on all revenue schedule lines up until today.
Configurable object allowing recognition take into account customisation.
Return Value
Id of the executing fferpcore__ProcessRun__c record.
Sample Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//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 asynchronously create a Revenue Recognition Transaction with associated lines for each
// source record type and revenue stream based on the Revenue Schedule Line Id passed in to the service method.
// If the provided ffrr.RecognitionFilters configuration object has no fromDate all valid records from start of time will be retrieved
// If the provided ffrr.RecognitionFilters configuration object has no untilDate all valid records until end of time will be retrieved
// If the provided ffrr.RecognitionFilters configuration object has no revenueScheduleLineIds all valid records will be retrieved in conjunction of the fromDate and untilDate
// Retrieve the Ids of the Revenue Schedule Lines that will be used to create Revenue Recognition Transactions from.
Map<Id, ffrr__RevenueScheduleLine__c> scheduleLinesByIds = newMap<Id, ffrr__RevenueScheduleLine__c>([SELECT Id, Name FROM ffrr__RevenueScheduleLine__c]);
// Set the allOrNone configuration to false to continue with schedule generation process even if one or more of the schedules could not be created
config.allOrNone = false;
Properties
Name
Type
Description
allOrNone
Boolean
Boolean to specify whether the generation should be all or none. If true when a record is invalid then all schedules will fail to be generated. If false, only valid records will cause a schedule to be generated. If unset defaults to true.
Identifies the information to be recognized by a recognize method. Adding multiple filters, such as line ids and an until date will join the filter together with an AND. This means only RSL with Ids in your Id set and date =< untilDate will be processed.
Sample Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//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 recognizing of Revenue Schedules should be performed
// Sets the optional revenue schedule line Ids to be taken into consideration when recognizing schedules
// If passed in only those schedule lines will be recognized, otherwise all valid schedule lines will be recognized
Map<Id, ffrr__RevenueScheduleLine__c> scheduleLinesByIds = newMap<Id, ffrr__RevenueScheduleLine__c>([SELECT Id, Name FROM ffrr__RevenueScheduleLine__c]);
global void setRevenueScheduleLineIds(Set<Id> revenueScheduleLineIds)
Sets the optional revenue schedule line Ids to be taken into consideration when recognizing schedules If passed in only those schedule lines will be recognized, otherwise all valid schedule lines will be recognized
global void setRevenueScheduleLineIds(List<Id> revenueScheduleLineIds)
Sets the optional revenue schedule line Ids to be taken into consideration when recognizing schedules If passed in only those schedule lines will be recognized, otherwise all valid schedule lines will be recognized