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
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
1 2 3 4 5 6 | Set<Id> sourceRecordIds = new Set<Id>();
ffrr.SourceRecordSetupService.setup(sourceRecordIds);
|
|