Revenue Management API Developer Reference

ffrr.SourceRecordSetupService

global with sharing class SourceRecordSetupService

Provides methods to allow automated setup of source records. Currently supported objects are blng__InvoiceLine__c, blng__CreditNoteLine__c, OrderItem and blng__UsageSummary__c.

Methods

setup

global static List<SObject> setup(Set<Id> sourceIds)

Given a Set<Id> sourceIds, goes though the sourceRecords related to the Ids and populates:
- Each record's Actuals Template field (specified in custom settings) with the mapped template.
- Each record's Balance Sheet Account and Income Statement Account with the mapped GL Accounts. The ffrr__Template__c to be mapped to a record should be set on the appropriate blng__RevenueRecognitionTreatment__c on the blng__RevenueRecognitionRule__c related to the Product2 related to the source object. The GLAs to be mapped to a record should be set on the appropriate GL treatment, on the GL Rule found on the aforementioned blng__RevenueRecognitionTreatment__c.
This API will perform in system mode. It will update any source records with mapped data passed into it regardless of permissions.

Input Parameters

Name Type Description
sourceIds Set<Id> Ids of source records on to which the templates and GLAs will be mapped.

Return Value

List<SObjects> with populated ffrr__Template__c and GLA mappings.

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.

Set<Id> sourceRecordIds = new Set<Id>(); // Ids of objects to add recognition templates to.
ffrr.SourceRecordSetupService.setup(sourceRecordIds);
© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.