ffrr.CalendarServiceglobal with sharing class CalendarService MethodscreateYearsglobal static Map<Id, List<Id>> createYears(List<ffrr.CalendarService.RecognitionYear> years) Commit a list of Recognition Years with periods generated according to each year's period calculation basis. Input Parameters
Return ValueA map of the committed year Ids to their respective period Ids. 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. // In this example years will be created and passed to the API where the periods will be generated and // both the year and periods are committed to the database. ffrr.CalendarService.RecognitionYear year2014 = new ffrr.CalendarService.RecognitionYear(); year2014.Name = '2014'; year2014.StartDate = Date.newInstance(2014, 1, 1); year2014.NumberOfMonths = 12; year2014.PeriodCalculationBasis = 'Month'; ffrr.CalendarService.RecognitionYear year2015 = new ffrr.CalendarService.RecognitionYear(); year2015.Name = '2015'; year2015.StartDate = Date.newInstance(2015, 1, 1); year2015.NumberOfWeeks = 52; year2015.PeriodCalculationBasis = '4,4,5'; // The returned result is a Map of the yearIds and the period Ids created for those years. Map<Id, List<Id>> periodIdsByYearIdMap = ffrr.CalendarService.createYears(new List<ffrr.CalendarService.RecognitionYear>{ year2014, year2015 }); ffrr.CalendarService.RecognitionYearglobal with sharing class RecognitionYear This represents a Recognition Year record. Properties
MethodsRecognitionYearglobal RecognitionYear() |