Recurrence rules for user interface

An application exposes recurrence management in a much different way than it is persisted on an event record. The user inputs are structured as independent fields, yet the persistence format holds the entire recurrence rule in a single string. The following figure shows an example of an application-developed user interface presenting a weekly, every Monday with no end, recurrence rule for an event:
Figure 1. Recurrence rule example
The image is explained in the text.

To move data in to and out of this RRULE string, the platform uses formula functions that have knowledge about the structured fields that an applications can present in a recurrence rule form. The following is a list of fields the platform reads to, writes from, or both, in the createRruleFromEventUi() and applyRruleToEventUi() functions.

Table 1. Business object fields related to the recurrence rule
Business Object Field Name Description of valid values
RecurrencePatternType DAILY/WEEKLY/MONTHLY/YEARLY
DailyRecurrenceDays Number representing the number of days between occurrences of a daily event.

WeeklySunday

WeeklyMonday

WeeklyTuesday

WeeklyWednesday

WeeklyThursday

WeeklyFriday

WeeklySaturday

Boolean representing whether the weekly event should fall on this day.
WeeklyRecurrenceWeeks Number representing the number of weeks between occurrences of a weekly event.
MonthlyWeekOfMonth Number representing the week of a month on which an occurrence should occur for a monthly event. Negative numbers represent, for example, the second-to-last week of a month.
MonthlyDayOfMonth Number representing the day of a month on which an occurrence should occur for a monthly event. Negative numbers represent, for example, the second-to-last day of a month.
MonthlyRecurrenceMonths Number representing the number of months between occurrences of a monthly event.
YearlyDayOfMonth Number representing the day of the month on which an occurrence should occur for a yearly event. Negative numbers represent, for example, the second-to-last day of a month.
YearlyWeekOfMonth Number representing the week of a month on which an occurrence should occur for a yearly event. Negative numbers represent, for example, the second-to-last week of a month.
YearlyMonth Number representing the month of a year on which an occurrence should occur for a yearly event.
YearlyDayOfWeek Number representing the day of a week on which an occurrence should occur for a yearly event. Negative numbers represent, for example, the second-to-last day of a week.
EndDate The end date beyond which no more occurrences should occur.
NoOfOccurrencesBeforeEnd Number indicating the number of occurrences that should occur before the recurring event is complete.
NoEndDate Boolean indicating whether this event has no end date.

When a record is passed in to the createRruleFromEventUi() function, the platform reads the recurrence data from the input fields in order to construct an iCal-compliant RRULE string.

When an RRULE string and a record is passed into the applyRruleToEventUi() function. the platform deconstructs the RRULE and applies it appropriately to the input fields to enable an application to render the RRULE in a structured format.