Revenue Management API Developer Reference

ffrr.RRTCreateJournalsService

global with sharing class RRTCreateJournalsService

Methods

createRRTToJournalAsync

global static Set<Id> createRRTToJournalAsync(ffrr.RRTCreateJournalsService.CreateJournalRequest integrationRequest)

This method creates accounting journals for specified revenue recognition transactions. Information is passed between Revenue Management and FinancialForce Accounting via Foundations using the Journal.Create message type. NOTE: Journal lines can be created from revenue recognition transaction lines or from revenue transaction summaries depending on the createJournalUsingSummaries boolean parameter passed into the integrationRequest.

Input Parameters

Name Type Description
integrationRequest ffrr.RRTCreateJournalsService.CreateJournalRequest Structure containing the IDs of revenue transactions that accounting journals will be created for, and the boolean createJournalUsingSummaries which determines whether journal lines are created from revenue recognition transaction lines or revenue transaction summaries.

Return Value

This method returns the IDs of the batch jobs that will create the accounting journal.

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.

//This method creates accounting journals for specified revenue recognition transaction.

//IDs of Revenue Recognition Transactions that FFA Journals will be created for. In order to be eligible for journal creation, the records associated with these IDs must have a Status of Committed, a GroupBy field which contains an FFA usercompany value, and the Journal field must be empty
Set<Id> revenueRecognitionIds = new Set<Id>{'a1ga00000111sg1', 'a1ga00000111sg2'};

//This request containing the IDs of revenue transaction that accounting journal will be created for
ffrr.RRTCreateJournalsService.CreateJournalRequest request = new ffrr.RRTCreateJournalsService.CreateJournalRequest(revenueRecognitionIds);

//This method returns the IDs of the batch jobs that will create the accoutning journal.
Set<Id> asyncBatchJobIDs = ffrr.RRTCreateJournalsService.createRRTToJournalAsync(request);

validateRevenueRecognitionTransactions

global static Map<Id, String> validateRevenueRecognitionTransactions(ffrr.RRTCreateJournalsService.CreateJournalRequest integrationRequest)

This method validates revenue transactions and either their transaction line items or their revenue transaction summaries for accounting journal creation. To validate a revenue transaction with revenue transaction summaries, please call an appropriate constructor of integrationRequest. Return any invalid revenue transactions in a map with the relevant error message. Journals can only be created for revenue transactions that have the status Committed, a valid Grouped By value, and that do not already have lookup to an accounting journal. To create journals using summary records, revenue transactions must also have revenue transaction summaries.

Input Parameters

Name Type Description
integrationRequest ffrr.RRTCreateJournalsService.CreateJournalRequest Structure containing the IDs of revenue transactions to be validated, and the boolean createJournalUsingSummaries which determines whether journal lines are to be created from revenue recognition transaction lines or revenue transaction summaries.

Return Value

This method returns a map containing the IDs of invalid revenue transactions with their validation error messages. If all the revenue transactions are valid, this method returns an empty map.

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.

//This method validates revenue recognition transactions for accounting journal creation. Return any invalid revenue recognition transactions in a map with the relevant error message.

//IDs of Revenue Recognition Transactions that FFA Journals will be created for. In order to be eligible for journal creation, the records associated with these IDs must have a Status of Committed, a GroupBy field which contains an FFA usercompany value, and the Journal field must be empty
Set<Id> revenueRecognitionIds = new Set<Id>{'a1ga00000111sg1', 'a1ga00000111sg2'};

// This request containing the Ids of revenue transaction that accounting journal will be created for
ffrr.RRTCreateJournalsService.CreateJournalRequest request = new ffrr.RRTCreateJournalsService.CreateJournalRequest(revenueRecognitionIds);

//This method returns a map containing the Ids of invalid revenue transactions with their validation error messages. If all the revenue transactions are valid, this method returns an empty map.
Map<Id, String> exceptionMessageMapByRRTId = ffrr.RRTCreateJournalsService.validateRevenueRecognitionTransactions(request);

createRRTToJournal

global static Map<Id, ffrr.RRTCreateJournalsService.CreateJournalResponse> createRRTToJournal(ffrr.RRTCreateJournalsService.CreateJournalRequest integrationRequest)

This method creates accounting journals for specified revenue recognition transactions synchronously. Information is passed between Revenue Management and FinancialForce Accounting via Foundations using the Journal.Create message type.
NOTE: Journal lines can be created from revenue recognition transaction lines or from revenue transaction summaries depending on the createJournalUsingSummaries boolean parameter passed into the integrationRequest.

Input Parameters

Name Type Description
integrationRequest ffrr.RRTCreateJournalsService.CreateJournalRequest Structure containing the IDs of revenue transactions that accounting journals will be created for, and the boolean createJournalUsingSummaries which determines whether journal lines are created from revenue recognition transaction lines or revenue transaction summaries.

Return Value

This method returns a map containing the IDs of revenue transactions with information about the revenue and cost journals that you attempted to create and whether or not they were created successfully.

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.

//This method creates accounting journals for specified revenue recognition transaction through sync process.

//IDs of Revenue Recognition Transactions that FFA Journals will be created for. In order to be eligible for journal creation, the records
//associated with these IDs must have a Status of Committed, a GroupBy field which contains an FFA usercompany value, and the Journal field must
//be empty
Set<Id> revenueRecognitionIds = new Set<Id>{'a1ga00000111sg1', 'a1ga00000111sg2'};

//Set property true if journals need be created from Revenue Recognition Summary records
Boolean shouldCreateJournalFromSummary = true;

//This request containing the IDs of revenue transaction that accounting journal will be created for
ffrr.RRTCreateJournalsService.CreateJournalRequest request = new ffrr.RRTCreateJournalsService.CreateJournalRequest(revenueRecognitionIds, shouldCreateJournalFromSummary);

//This method returns a map containing the IDs of revenue transactions with information about the revenue and cost journals that you attempted
//to create and whether or not they were created successfully. Fields in the CreateJournalResponse are populated with "null" if they are not
//relevant to the current process. For example, if the process creates a revenue journal successfully, then the following fields are all
//populated with "null": revenueJournalCreationError, costJournalId, costJournalCreationStatus, costJournalCreationError.
Map<Id, RRTCreateJournalsService.CreateJournalResponse> journalResponseMap = ffrr.RRTCreateJournalsService.createRRTToJournal(request);
System.debug('Response: ' + journalResponseMap);

ffrr.RRTCreateJournalsService.CreateJournalRequest

global class CreateJournalRequest

Class containing information regarding RRT to Journal creation.

Properties

Name Type Description
revenueRecognitionIds Set<Id> Set of Revenue Transaction Ids.
shouldCreateJournalFromSummary Boolean When true journals will be created from Revenue Recognition Summary records otherwise Journals will be created from Revenue Recognition Transaction Line Items. The default is false.

Methods

CreateJournalRequest

global CreateJournalRequest(Set<Id> revenueRecognitionIds)

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.

//IDs of Revenue Recognition Transactions that FFA Journals will be created for. In order to be eligible for journal creation,
//the records associated with these IDs must have a Status of Committed, a GroupBy field which contains an FFA usercompany value,
//and the Journal field must be empty.
Set<Id> revenueRecognitionIds = new Set<Id>{'a1ga00000111sg1', 'a1ga00000111sg2'};
//Create the CreateJournalRequest for Journal creation using Revenue Recognition Transactions and it's line items
ffrr.RRTCreateJournalsService.CreateJournalRequest request = new ffrr.RRTCreateJournalsService.CreateJournalRequest(revenueRecognitionIds);

CreateJournalRequest

global CreateJournalRequest(Set<Id> revenueRecognitionIds, Boolean shouldCreateJournalFromSummary)

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.

//IDs of Revenue Recognition Transactions that FFA Journals will be created for. In order to be eligible for journal creation,
//the records associated with these IDs must have a Status of Committed, a GroupBy field which contains an FFA usercompany value,
//the Journal field must be empty, and summary records must exist.
Set<Id> revenueRecognitionIds = new Set<Id>{'a1ga00000111sg1', 'a1ga00000111sg2'};
//Determines whether journal lines are created from revenue recognition transaction lines or revenue transaction summaries.
Boolean shouldCreateJournalFromSummary = true;
//Create the CreateJournalRequest for Journal creation using Revenue Recognition Transactions and it's summary records
//Boolean property shouldCreateJournalFromSummary with true value should be passed only if journal need to be created using Revenue Recognition Transactions and it's summary records
ffrr.RRTCreateJournalsService.CreateJournalRequest request = new ffrr.RRTCreateJournalsService.CreateJournalRequest(revenueRecognitionIds, shouldCreateJournalFromSummary);

ffrr.RRTCreateJournalsService.CreateJournalResponse

global class CreateJournalResponse

Class containing the response for the RRT to Journal creation process.

Properties

Name Type Description
revenueJournalId Id ID of a revenue journal that has been created..
costJournalId Id ID of a cost journal that has been created.
revenueJournalCreationStatus String Status of the process to create the revenue journal, e.g. OK or Error.
costJournalCreationStatus String Status of the process to create the cost journal, e.g. OK or Error.
revenueJournalCreationError String Error message (if any) resulting for the revenue journal creation process.
costJournalCreationError String Error message (if any) resulting for the cost journal creation process.

Methods

CreateJournalResponse

global CreateJournalResponse()

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