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.
MethodsrunProcessesglobal 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 ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.CreateJournals; ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(firstProcess, lastProcess); // 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 firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(firstProcess, lastProcess); // 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) ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Recognize; ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.CreateJournals; Boolean summarizeTransactions = false; ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(firstProcess, lastProcess, summarizeTransactions); // 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 firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Recognize; ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.CreateJournals; Boolean summarizeTransactions = false; //Create filters Set<String> filteredCompanies = new Set<String>{ 'Company A' }; Set<String> filteredCurrencies = new Set<String>{ 'USD' }; ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters( filteredCompanies, filteredCurrencies ); ffrr.RevenueScheduleAutomationService.AutomationConfig config = new ffrr.RevenueScheduleAutomationService.AutomationConfig(firstProcess, lastProcess, 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); 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 firstProcess, following the order of processes in the AutomationProcess enum until lastProcess is reached (inclusive) //In this example, Generate, Recognize and Summarize will be run in that order. ffrr.RevenueScheduleAutomationService.AutomationProcess firstProcess = ffrr.RevenueScheduleAutomationService.AutomationProcess.Generate; ffrr.RevenueScheduleAutomationService.AutomationProcess lastProcess = 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(firstProcess, lastProcess, summarizeTransactions); //Indicates if the email notifications should be sent after each individual process has completed config.shouldSendEmailAtEndOfProcesses = false; Set<String> filteredCompanies = new Set<String>{ 'Company A' }; Set<String> filteredCurrencies = new Set<String>{ 'USD' }; ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters( filteredCompanies, filteredCurrencies ); //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.AutomationResultglobal with sharing class AutomationResult Class used to return results of automation 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. 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 and a currency //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' }; //Create filters object containing the companies and currencies to filter on. ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters( filteredCompanies, filteredCurrencies ); //example 2 - Filter has only a single company //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; //Create filters object containing the companies and currencies to filter on. ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters( filteredCompanies, filteredCurrencies ); //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; //Create filters object containing the companies and currencies to filter on. ffrr.RevenueScheduleAutomationService.AutomationFilters filters = new ffrr.RevenueScheduleAutomationService.AutomationFilters( filteredCompanies, filteredCurrencies ); MethodsAutomationFiltersglobal AutomationFilters(Set<String> filteredCompanies, Set<String> filteredCurrencies) Construct a AutomationFilters object with the specified filters. Input Parameters
|