c2g.BackgroundPostingSchedulerServiceglobal with sharing class BackgroundPostingSchedulerService the service class relating to background posting scheduler. Properties
Methods
runNowglobal static void runNow() Runs any background posting jobs with a status of “waiting”. See "About the Background Posting Scheduler" in the FinancialForce Help for more details. Use ScheduleAndRunBackgroundPosting (Schedule and Run Background Posting) custom permission to grant permissions on this method. runNowglobal static void runNow(String documentType) Runs the background posting scheduler for the specified document type. Use ScheduleAndRunBackgroundPosting (Schedule and Run Background Posting) custom permission to grant permissions on this method. Input Parameters
scheduleBySettingsObjectglobal static c2g.BackgroundPostingSchedulerService.ScheduleResult scheduleBySettingsObject(c2g.BackgroundPostingSchedulerService.ScheduleSettings settings) Creates a schedule to control the frequency of the batch processing. Use ScheduleAndRunBackgroundPosting (Schedule and Run Background Posting) custom permission to grant permissions on this method. Input Parameters
Return ValueThis service returns a c2g.BackgroundPostingSchedulerService.ScheduleResult 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. BackgroundPostingSchedulerService.PostingSchedulerConstants constants = new BackgroundPostingSchedulerService.PostingSchedulerConstants(); BackgroundPostingSchedulerServiceImpl impl = new BackgroundPostingSchedulerServiceImpl(); // Options for schedule. String selectedInterval = '1'; String selectedOffset = '0'; Integer selectedMonthItem = constants.MONTH_ITEM_DOM; String selectedDayOccurance = '1'; String[] selectedWeekDays = new String[]{'1', '3'}; String selectedWeekDay = '1'; String selectedMonthDay = 12; String selectedTime = '0'; String selectedFrequencyType = 'HOURLY'; // Put the options in a settings object. BackgroundPostingSchedulerService.ScheduleSettings settings = new BackgroundPostingSchedulerService.ScheduleSettings( selectedTime, selectedFrequencyType, selectedMonthItem, selectedMonthDay, selectedWeekDay, selectedDayOccurance, selectedWeekDays, selectedOffset, selectedInterval); BackgroundPostingSchedulerService.scheduleBySettingsObject(settings); c2g.BackgroundPostingSchedulerService.ScheduleResultglobal class ScheduleResult holds information about the status of an attempt to schedule. 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 code is for demonstration purposes only // Simple check for success. BackgroundPostingSchedulerService.ScheduleResult result; result = serviceImpl.scheduleBySettingsObject(completeSettings); if (result.isScheduled) { //… } Properties
c2g.BackgroundPostingSchedulerService.ScheduleSettingsglobal class ScheduleSettings this data type allows you to specify the settings of a background posting scheduler schedule. 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. BackgroundPostingSchedulerService.PostingSchedulerConstants constants = new BackgroundPostingSchedulerService.PostingSchedulerConstants(); BackgroundPostingSchedulerServiceImpl impl = new BackgroundPostingSchedulerServiceImpl(); // Options for schedule. String selectedInterval = '1'; String selectedOffset = '0'; Integer selectedMonthItem = constants.MONTH_ITEM_DOM; String selectedDayOccurance = '1'; String[] selectedWeekDays = new String[]{'1', '3'}; String selectedWeekDay = '1'; String selectedMonthDay = 12; String selectedTime = '0'; String selectedFrequencyType = 'HOURLY'; // Put the options in a settings object. BackgroundPostingSchedulerService.ScheduleSettings settings = new BackgroundPostingSchedulerService.ScheduleSettings( selectedTime, selectedFrequencyType, selectedMonthItem, selectedMonthDay, selectedWeekDay, selectedDayOccurance, selectedWeekDays, selectedOffset, selectedInterval); BackgroundPostingSchedulerService.scheduleBySettingsObject(settings); Properties
MethodsScheduleSettingsglobal ScheduleSettings() |