Revenue Management API Developer Reference

ffrr.CalendarService

global with sharing class CalendarService

Methods

createYears

global 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

Name Type Description
years List<ffrr.CalendarService.RecognitionYear> The years to commit and generate periods for.

Return Value

A 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.RecognitionYear

global class RecognitionYear

this represents a recognition year record.

Properties

Name Type Description
Id Id the id of the recognition year.
Name String the name of the recognition year.
NumberOfMonths Decimal the number of months in the recognition year, in the range 1-18. required if the period calculation basis is month or month end. either number of months should be set or number of weeks.
NumberOfWeeks Decimal the number of weeks in the recognition year, in the range 13-79. this must be a number divisible by 13 (13, 26, 39, 52, 65, 78) or divisible by 13 plus one week (14, 27, 40, 53, 66, 79). required if the period calculation basis is 445, 454, or 544. either number of months should be set or number of weeks.
PeriodCalculationBasis String the period calculation basis for the recognition year. permitted values are: '4,4,5', '4,5,4', '5,4,4', 'month', 'month end'.
StartDate Date the start date of the recognition year.

Methods

RecognitionYear

global RecognitionYear()

© Copyright 2009–2021 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.