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 Certinia 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 with sharing 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 with sharing 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() |