ffrr.RevenueScheduleAutomationServiceglobal with sharing class RevenueScheduleAutomationService Contains methods for Recognition Schedule automation. EnumsAutomationProcessDenotes an individual process that can be run by the automation service. The order these are listed here is the same order in which the processes will be run, if selected.
PeriodToSelectUpToDenotes the cutoff period for including schedule lines for recognition.
PeriodToRecognizeIntoDenotes the period that recognized values will be committed into.
Methods
runProcessesglobal static ffrr.RevenueScheduleAutomationService.AutomationResult runProcesses(ffrr.RevenueScheduleAutomationService.AutomationConfig configuration) Runs the recognition schedule processes specified by the ffrr.RevenueScheduleAutomationService.AutomationConfig object from the first process to last process. See the RevenueScheduleAutomationService.AutomationProcess enum for the available values. The order in which these processes happens is as follows: Input Parameters
Exceptions Thrown
Return ValueReturns a ffrr.RS_AutomationService.AutomationResult object. 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. // example 1 // In this example the automation service has been asked to run from Generate to CreateJournals including summarizing the transactions. // The processes will be chained from one to the other including the steps in between eg. Generate, Recognize, Summarize, CreateJournals // The Recognize process will select schedule lines up to and including the previous period, and recognize them into the previous period (default). ffrr.RevenueScheduleAutomationService.AutomationProcess startProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationProcess endProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.CreateJournals; ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(startProcess, endProcess); // call the run processes method to chain the configured processes together and set the first one running. ffrr.RevenueScheduleAutomationService.AutomationResult result = ffrr.RevenueScheduleAutomationService.runProcesses(config); // example 2 // In this example the automation service is being used to run only a single process Generate. ffrr.RevenueScheduleAutomationService.AutomationProcess startProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationProcess endProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(startProcess, endProcess); // call the run processes method to chain the configured processes together and set the first one running. ffrr.RevenueScheduleAutomationService.AutomationResult result = ffrr.RevenueScheduleAutomationService.runProcesses(config); // example 3 // In this example only the Recognize and CreateJournals method will be called (creating journals from recognition lines) // The Recognize process will select schedule lines up to and including the current period, and recognize them into the current period. ffrr.RevenueScheduleAutomationService.AutomationProcess startProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Recognize; ffrr.RevenueScheduleAutomationService.AutomationProcess endProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.CreateJournals; Boolean summarizeTransactions = false; ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(startProcess, endProcess, summarizeTransactions); ffrr.RevenueScheduleAutomationService.RecognitionConfig recognitionConfig = new ffrr.RevenueScheduleAutomationService.RecognitionConfig(); recognitionConfig.selectionPeriod = ffrr.RevenueScheduleAutomationService.PeriodToSelectUpTo.Current; recognitionConfig.recognitionPeriod = ffrr.RevenueScheduleAutomationService.PeriodToRecognizeInto.Current; config.recognitionConfig = recognitionConfig; // call the run processes method to chain the configured processes together and set the first one running. ffrr.RevenueScheduleAutomationService.AutomationResult result = ffrr.RevenueScheduleAutomationService.runProcesses(config); // example 4 // In this example filters are added to the config. These will be applied to each of the automation processes run: in this example, Recognize through to Create Journals. // They are also used in asynchronous clash checking for automation processes that clash. ffrr.RevenueScheduleAutomationService.AutomationProcess startProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Recognize; ffrr.RevenueScheduleAutomationService.AutomationProcess endProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.CreateJournals; Boolean summarizeTransactions = false; //Create filters Set<String> filteredCompanies = new Set<String>{ 'Company A' }; Set<String> filteredCurrencies = new Set<String>{ 'USD' }; Set<String> filteredRecognitionStreams = new Set<String>{ 'fferpcore__BillingDocument__c' }; ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters(); filters.setCompanies(filteredCompanies); filters.setCurrencies(filteredCurrencies); filters.setRecognitionStreams(filteredRecognitionStreams); ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(startProcess, endProcess, summarizeTransactions); //Specify filters to apply to each of the automation processes. config.filter = filters; // call the run processes method to chain the configured processes together and set the first one running. ffrr.RevenueScheduleAutomationService.AutomationResult result = ffrr.RevenueScheduleAutomationService.runProcesses(config); runProcessesglobal static ffrr.RevenueScheduleAutomationService.AutomationResult runProcesses(Id configId) Runs the recognition schedule processes specified by the AutomationConfiguration__c object with ID configId. Input Parameters
Exceptions Thrown
Return ValueReturns a ffrr.RS_AutomationService.AutomationResult object. 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. //Get the Id of the AutomationConfiguration__c to run. ffrr__AutomationConfiguration__c automationConfigurationToRun = [SELECT Id FROM ffrr__AutomationConfiguration__c WHERE Name = 'ConfigToRun' LIMIT 1]; Id automationConfigurationId = automationConfigurationToRun.Id; //Call runProcesses with the Id to run the associated automation configuration. ffrr.RevenueScheduleAutomationService.AutomationResult result = ffrr.RevenueScheduleAutomationService.runProcesses(automationConfigurationId); saveConfigurationglobal static ffrr.RevenueScheduleAutomationService.ConfigurationSaveResult saveConfiguration(ffrr.RevenueScheduleAutomationService.AutomationConfigurationCreationDetails creationDetails) Saves an automation configuration as specified by the AutomationConfigurationCreationDetails. Input Parameters
Exceptions Thrown
Return ValueReturns a ffrr.RS_AutomationService.ConfigurationSaveResult object. 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. //Create the AutomationConfigurationCreationDetails object. //This includes the AutomationConfig and the name that the automation configuration record should be saved with. ffrr.RevenueScheduleAutomationService.AutomationProcess startProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationProcess endProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Summarize; Boolean summarizeTransactions = true; ffrr.RevenueScheduleAutomationService.AutomationConfig automationConfig = new ffrr.RevenueScheduleAutomationService.AutomationConfig(startProcess, endProcess, summarizeTransactions); ffrr.RevenueScheduleAutomationService.AutomationConfigurationCreationDetails creationDetails = new ffrr.RevenueScheduleAutomationService.AutomationConfigurationCreationDetails(); creationDetails.config = automationConfig; creationDetails.automationConfigName = 'My Automation Config'; //Save the created automation configuration. ffrr.RevenueScheduleAutomationService.ConfigurationSaveResult result = ffrr.RevenueScheduleAutomationService.saveConfiguration(creationDetails); //The returned ConfigurationSaveResult includes the AutomationConfiguration__c record that has been saved. ffrr__AutomationConfiguration__c savedAutomationConfiguration = result.config; ffrr.RevenueScheduleAutomationService.AutomationConfigglobal with sharing class AutomationConfig Class used to pass configuration to automation API call. 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. //Configure which processes should be run, starting from startProcess, following the order of processes in the AutomationProcess enum until endProcess is reached (inclusive) //In this example, Generate, Recognize and Summarize will be run in that order. ffrr.RevenueScheduleAutomationService.AutomationProcess startProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationProcess endProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Summarize; //Set if transactions should be summarized when Summarize is included in the processes to run. //Additionally, if the CreateJournals process is included in the processes to run, sets if journals should be created from transaction summaries (if true) or from transaction lines (if false). Boolean summarizeTransactions = true; ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(startProcess, endProcess, summarizeTransactions); //Indicates if the email notifications should be sent after each individual process has completed config.shouldSendEmailAtEndOfProcesses = false; // For the Recognize process, configure the cutoff period for including schedule lines for recognition, and the period to commit recognized values into. // In this example, schedule lines up to and including the previous period will be selected, and then recognized into the current period. // By default, if the configuration includes the Recognize process, schedule lines up to and including the previous period will be selected, and recognized into the previous period. ffrr.RevenueScheduleAutomationService.RecognitionConfig recognitionConfig = new ffrr.RevenueScheduleAutomationService.RecognitionConfig(); recognitionConfig.selectionPeriod = ffrr.RevenueScheduleAutomationService.PeriodToSelectUpTo.Previous; recognitionConfig.recognitionPeriod = ffrr.RevenueScheduleAutomationService.PeriodToRecognizeInto.Current; config.recognitionConfig = recognitionConfig; Set<String> filteredCompanies = new Set<String>{ 'Company A' }; Set<String> filteredCurrencies = new Set<String>{ 'USD' }; Set<String> filteredRecognitionStreams = new Set<String>{ 'fferpcore__BillingDocument__c' }; ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters(); filters.setCompanies(filteredCompanies); filters.setCurrencies(filteredCurrencies); filters.setRecognitionStreams(filteredRecognitionStreams); //Specify filters to apply to each of the automation processes. config.filter = filters; Properties
Methods
AutomationConfigglobal AutomationConfig(ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess, ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess) AutomationConfigglobal AutomationConfig(ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess, ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess, Boolean summarizeTransactions) ffrr.RevenueScheduleAutomationService.RecognitionConfigglobal with sharing class RecognitionConfig DTO used to pass configuration specific to the Recognize process as part of a ffrr.RevenueScheduleAutomationService API call. Properties
MethodsRecognitionConfigglobal RecognitionConfig() ffrr.RevenueScheduleAutomationService.AutomationConfigurationCreationDetailsglobal inherited sharing class AutomationConfigurationCreationDetails DTO used to request the creation of a new AutomationConfiguration__c record via the API. 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. //Create the AutomationConfig object to save. ffrr.RevenueScheduleAutomationService.AutomationProcess startProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationProcess endProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Summarize; Boolean summarizeTransactions = true; ffrr.RevenueScheduleAutomationService.AutomationConfig automationConfig = new ffrr.RevenueScheduleAutomationService.AutomationConfig(startProcess, endProcess, summarizeTransactions); //Create the AutomationConfigurationCreationDetails object. //This includes the AutomationConfig created above, and the name that the automation configuration record should be saved with. ffrr.RevenueScheduleAutomationService.AutomationConfigurationCreationDetails creationDetails = new ffrr.RevenueScheduleAutomationService.AutomationConfigurationCreationDetails(); creationDetails.config = automationConfig; creationDetails.automationConfigName = 'My Automation Config'; Properties
MethodsAutomationConfigurationCreationDetailsglobal AutomationConfigurationCreationDetails() ffrr.RevenueScheduleAutomationService.AutomationResultglobal with sharing class AutomationResult Class used to return results of automation API call. Properties
ffrr.RevenueScheduleAutomationService.ConfigurationSaveResultglobal with sharing class ConfigurationSaveResult Class used to return the results of saving a new AutomationConfiguration__c via an API call. Properties
ffrr.RevenueScheduleAutomationService.AutomationFiltersglobal inherited sharing class AutomationFilters extends ProcessFilters Class used to store the filters to be applied to an automation process. A filter is a set of permitted values for a specified field. This class contains deprecated items. 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. //example 1 - Filter has a company, currency and recognition stream //Specify companies to filter on. Set<String> filteredCompanies = new Set<String>{ 'Company A' }; //Specify currencies to filter on. Set<String> filteredCurrencies = new Set<String>{ 'USD' }; //Specify recognition streams to filter on. Set<String> filteredRecognitionStreams = new Set<String>{ 'fferpcore__BillingDocument__c' }; //Create filters object containing the companies and currencies to filter on. ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters(); filters.setCompanies(filteredCompanies); filters.setCurrencies(filteredCurrencies); filters.setRecognitionStreams(filteredRecognitionStreams); //example 2 - Filter has only a single company and a single recognition stream //Specify companies to filter on. Set<String> filteredCompanies = new Set<String>{ 'Company A' }; //Specify null, or an empty set of type String, to provide no filter. Set<String> filteredCurrencies = new Set<String>(); // Alternatively, Set<String> filteredCurrencies = null; //Specify recognition streams to filter on. Set<String> filteredRecognitionStreams = new Set<String>{ 'fferpcore__BillingDocument__c' }; //Create filters object containing the companies and currencies to filter on. ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters(); filters.setCompanies(filteredCompanies); filters.setCurrencies(filteredCurrencies); filters.setRecognitionStreams(filteredRecognitionStreams); //example 3 - Filter on records where no company is set //Specify companies to filter on. //Note: '' or null can be used to denote no company. Set<String> filteredCompanies = new Set<String>{ null }; //Specify null, or an empty set of type String, to provide no filter. Set<String> filteredCurrencies = new Set<String>(); // Alternatively, Set<String> filteredCurrencies = null; //Specify recognition streams to filter on. Set<String> filteredRecognitionStreams = new Set<String>{ 'fferpcore__BillingDocument__c' }; //Create filters object containing the companies and currencies to filter on. ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters(); filters.setCompanies(filteredCompanies); filters.setCurrencies(filteredCurrencies); filters.setRecognitionStreams(filteredRecognitionStreams); Methods
AutomationFiltersglobal AutomationFilters() setCompaniesglobal void setCompanies(Set<String> companies) Sets the companies to be filtered on. If no companies are set all companies are included. Input Parameters
setCurrenciesglobal void setCurrencies(Set<String> currencies) Sets the currencies to be filtered on. If no currencies are set all currencies are included. Input Parameters
setRecognitionStreamsglobal void setRecognitionStreams(Set<String> recognitionStreams) Sets the recognition streams to be filtered on. If no recognition streams are set all recognition streams are included. Input Parameters
DeprecatedThe following items are deprecated and not supported for use. We recommend that you stop using these items to avoid exceptions. MethodsAutomationFiltersDeprecated: global AutomationFilters(Set<String> filteredCompanies, Set<String> filteredCurrencies) Construct a AutomationFilters object with the specified filters. Input Parameters
|