18 Understanding Calendar Controls

This chapter contains the following topics:

18.1 Calendar Controls

With the calendar control, you provide users with a graphical display of a calendar which can show activities (for example, meetings and appointments) and other time sensitive information. It contains three views: day view, week view and month view. It is also fully customizable: you can hide any view, customize work hours and work weeks, and so forth.

The calendar control does not support a business view (BV); hence, it does not fetch or save calendar data. It relies on application logic (BVs and table I/Os) to manage data. However, it does provide a set of event rules (ER) to load, view the details of, and add, delete, or modify calendar activities. An activity is a calendaring and scheduling entity that represents a designated amount of time on a calendar. Every calendar event, reminder, and so forth that users or the system schedules is an activity.

Note:

In Form Design Aid (FDA), events are points during runtime where you can execute code commands. However, events are also dates that you schedule on a calendar. To avoid confusion, use the term, activity, to mean the second kind of event.

The calendar control supports Universal Time (UT) and adjusts for user profile time zone settings. All activities appear based on the user's time zone daylight savings properties in user profile setting. The control itself does not include a function for reminders; therefore, reminder functions must be included as a part of the underlying application itself. The same is true for to-dos and attachments. If the application must display a to-do list, then it is recommended that you use a grid control to do so. The calendar control does not support the ability to attach items to an event directly on the control itself. However, a JD Edwards EnterpriseOne application can associate an attachment with each calendar activity and then display the attachment in the activity details form.

The calendar control does not support mobile devices currently.

The minimum dimensions of the control in FDA are 233 dialogue units high and 428 dialogue units wide. This is to ensure that the control will display correctly on 800 x 600 screen resolution settings. At a 1280 x 960 resolution, you might want a larger calendar control.

The only calendar control-specific design-time property you can set is which views are visible to the user. The calendar control has a variety of specialized system functions and ER.

18.2 Calendar Control Design-Time Considerations

You can choose to hide views from the user with a calendar control property. Alternatively, you can use the system function, Set View Visible, to hide and show views during runtime. Because the user must have at least one view to be able to interact with the control, FDA will not permit you to hide all of the views.

18.3 Calendar Control Events

These events, which are unique to calendar controls, can fire on this control:

  • Load Calendar Activity

  • Drill Into Calendar Activity

  • Drill Into Time Span

  • Add Activity Button Clicked

  • Post Add Activity Button Clicked

18.3.1 Load Calendar Activity

When the form is opened, after the Post Dialog Is Initialized form-level event, the Load Calendar Activity event fires for all calendar controls on the form. Inside this event, the application can use table I/O or business functions to read calendar data and add the activities to the calendar control for display. The system provides two system variable: SL_StartTime and SL_EndTime. These values define the time range that the calendar control displays. The application logic should fetch all calendar activities that fall between SL_StartTime and SL_EndTime. Both SL_StartTime and SL_EndTime are UTIME type variables.

The Load Calendar Activity event fires when the calendar control must display a time period so that the application has an opportunity to load the calendar activities in that time period and to display them on the calendar. For example, when a user navigates to a new day, week, or month, the Load Calendar Activity is triggered so that the application can load the activities for the new day, week, or month.

The calendar control provides activity caching. When a day, week, or month is revisited for the second time, the calendar control displays the cached activities for the day, week, or month unless the cache is cleared by the application logic. (One way to clear the calendar cache is to call the system function, Delete Calendar Activity, to delete all activities.)

Whenever you want to load the calendar with events that exist in a given time period, use this formula:

SELECT from where T2 >= S and T1 <= E

where

  • T2 is the activity end time,

  • S is the system variable, Slstart,

  • T1 is the activity start time, and

  • E is the system variable, Slend.

18.3.2 Drill Into Calendar Activity

The calendar control enables a user to click an activity. When that happens, the Drill Into Calendar Activity event fires. Consequently, application logic can open a JD Edwards EnterpriseOne form to display the details of the activity for user to modify or delete.

The system outputs a system variable, SL_CalendarActivityID, containing the ID of the Activity being clicked.

18.3.3 Drill Into Time Span

The calendar control enables a user to click a time span containing an activity. When that happens, the Drill Into Time Span event fires. Consequently, application logic can open a JD Edwards EnterpriseOne form for the user to create a new event. System variables, SL_StartTime and SL_EndTime, indicate the start and end of the time span the user has clicked.

Double-clicking an empty time span (that is, a time span to which no activity is currently assigned) calls the Add Calendar Activity system function.

18.3.4 Add Activity Button Clicked and Post Activity Button Clicked

The calendar control provides an Add button. When this button is clicked, the system triggers the Add Activity Button Clicked event and then the Post Add Activity Button Clicked event. Applications can use these events to open a JD Edwards EnterpriseOne form for user to create a new activity.

18.4 Calendar Control Runtime Processing

This section discusses runtime processing for calendar controls.

No control-specific runtime processing occurs upon form close.

18.4.1 Initialize the Control

When runtime initializes the calendar control, it loads the control and then fires the event, Load Calendar Activity. What runtime loads into the control is based on any system functions defined in ER for this event. The date range that defines the initial load is determined by the view (day, week, or month) that has been set. Keep in mind that while up to three views can be visible, the user can interact with only one at a time-the current calendar view.

Calendar view can be set by the system function, Select Calendar View. Alternatively, if only one view is visible because the other two have been hidden either by the system function, Set View Visible, or by disabling them at design-time, then runtime sets the one remaining view. In all other scenarios, the order of precedence for the view to set is day, week, then month.

Runtime sets the start and stop system variables (SL_StartTime and SL_EndTime, respectively) based on the current view. Then runtime passes the variables to Load Calendar Activity, and the system in turn populates the current view of the control. Only the activities for the current view are loaded. The control populates activities for other dates and views as the user travels to them.

18.4.2 Add a Calendar Activity

This scenario occurs most commonly as a result of control initialization or because a user travels to a date that he has not traveled to before during the course of the session. A user can travel to a new date by clicking the Next or Previous buttons.

Upon the button click, runtime uses ER to call the system function, Load Calendar Activity, with the start and end time being passed in as system values. Runtime derives the start and end times from the new date to which the user has just traveled. The system then populates the control with the newly fetched data.

After the initial fetch, data for each date is kept in memory to avoid unnecessary data refreshes. That is why runtime calls Load Calendar Activity only when the user travels to a date that has not been loaded for the current session.

18.4.3 Refresh the Control

Sometimes, you might want to force a refresh. To do so, call the system function, Delete Calendar Activity, and pass in Delete All Activities for the Activity ID parameter. Runtime responds by removing all activities from the entire control and flushing the memory where previously traveled-to dates are stored. Runtime also sets the start and stop system variables to match the view that is currently set. In other words, runtime places the control in a condition similar to being newly initialized.

After calling Delete Calendar Activity, call Load Calendar Activity, passing in the start and stop system variables (SL_StartTime and SL_EndTime) to populate the current control view.

18.5 Calendar Control System Functions

This section discusses the system functions unique to the calendar control.

In general, you can use system functions to perform these types of tasks:

  • Add, modify, or delete an activity from the calendar control.

  • Classify time ranges as being working, nonworking, or of another special type.

  • Modify aspects of the calendar control interface.

When you add an activity through the system function, Add Calendar Activity, or modify an activity using the system function, Modify Calendar Activity, you can affect these aspects of how the activity appears and acts on the calendar:

  • Name of the activity (subject).

  • Start and end day and time.

    The system requires this value in JDEUTime, even when you designate an activity as an all-day activity. You can also flag an activity for reoccurrence.

    If the start and stop times result in a span of time that is greater than or equal to 24 hours, then the system converts the activity to an all day activity. All day activities are displayed in the all day event area in the interface.

  • Additional information associated with the activity.

    You can set values for the type (meeting, appointment, and so forth), the commitment level (low, medium, or high), the activity location, and the activity organizer.

  • Private.

    This option causes the system to display a special icon next to the activity. No other logic is applied automatically, however. If you wish to restrict access to an event marked private, then you must do so within the application.

  • Font, color, and icons.

    You can set the font and related attributes, set a background color, and associate an icon with any activity. The icons from which you have to choose must already reside in the system. To add an icon to the list, save a GIF-type graphic in both of these locations: the B9\<pathcode>\res folder on the machine where FDA is located and the webclient.war/img/res folder on the machine or machines hosting the web server.

    When modifying an event, ensure that the ID value for the event exactly matches the ID as it appears in the table. For example, if the table column is left-padded, you must prefix the event ID as it appears in the control with the same number of characters that have been added to the event ID in the table because of the column formatting.

    When you delete an activity using the system function, Delete Calendar Activity, you remove it from the calendar control; you do not remove it from the database. You can choose to delete a single activity or multiple ones. You can also choose to clear the control of all activities.

In some cases, it might be helpful to assign different classifications to different date ranges. Typical classifications include working and nonworking (for example, holidays). Use Set Work Day Hours and Set Work Week to designate work time. Currently, Set Work Day Hours only affects full hours; it cannot accept half-hour increments, for example.

Furthermore, the work week must not contradict the work week system settings for the current country. For example, in the US, work weeks cannot end on Sunday or start on Saturday. Additionally, a work week cannot span these start and stop days. For example, you cannot start a work week on a Tuesday and end on a Monday.

Use Set Day Type to classify days as belonging to any other special categories.

The calendar control can provide users with three views: day, week, and month. Use Select Calendar View to display the calendar in a specific view type. You can also prevent users from being able to see a particular view type with Set View Visible.

The calendar control also provides an Add button. To change the text on the Add button, use Set Add Button Text. To hide the Add button and therefore prevent users from adding their own activities, use Set Add Button Visible.

Note:

The Add button has no underlying logic. If you choose to display the button, you should assign it some function on the Add Activity Button Clicked event.

Add Calendar Activity

Use this system function to add one activity to the calendar control.

Parameters

Calendar Control

Input, required. The calendar form control (FC) to affect.

Activity ID

Input, required. The ID of the activity in the database to be added to the calendar. Set the parameter to an applicable object from the object list.

Subject

Input, required. The title of the activity as it should appear on the calendar for the user. Set the parameter to an alphanumeric constant (<Literal>) or an applicable object from the object list.

Start Date and Time

Input, required if All Day Activity = False. The starting time and date, in UTime, for the activity. Literal date value in JDEUTime format.

End Date and Time

Input, required if All Day Activity = False. The ending time and date, in UTime, for the activity. Literal date value in JDEUTime format.

All Day Activity

Input, required. The indicator of whether the activity is to be displayed as an all day activity instead of having start and end date and times. Any activity that is equal to or greater than 24 hours automatically becomes an all day activity. All day activities are displayed in the all day activity area in the interface. Set the parameter to <TRUE>, <FALSE>, or an applicable object from the object list.

Recurrence

Input, required. The indicator of whether the activity occurs more than once. This parameter merely sets a flag; the control displays an icon to indicate that the activity has been flagged as reoccurring, but the system performs no other action in connection with recurrence. Set the parameter to <TRUE>, <FALSE>, or an applicable object from the object list.

Type

Input, required. The classification of the activity (meeting, appointment, and so forth). This parameter does not appear on the calendar. Set the parameter to an alphanumeric constant (<Literal>) or an applicable object from the object list.

Commitment Level

Input, required. The relative value of the activity. The value assigned affects the icon displayed and the color of the duration bar for the activity. Set the parameter to <Low Commitment> (1), <Default> (2), or <High> (3).

Private

Input, required. The indicator of whether to display the "private" icon. Set the parameter to <TRUE>, <FALSE>, or an applicable object from the object list.

Location

Input, required. The name of the place where the activity is to occur as it should appear on the calendar for the user. Set the parameter to an alphanumeric constant (<Literal>), <N/A>, or an applicable object from the object list.

Organizer

Input, required. The name of the creator of the activity as it should appear on the calendar for the user. Set the parameter to an alphanumeric constant (<Literal>), <N/A>, or an applicable object from the object list.

Font

Input, required. The font to use to display the activity to the user. Set the parameter to a font and related settings from the Font dialog (<Pick Font>) or the default font and related settings (<Reset Font>).

Bitmap

Input, required. The bitmap of an icon to display to the user on the calendar in association with the activity. To add an icon to the list, save a GIF-type graphic in both of these locations: The B9\<pathcode>\res folder on the machine where FDA is located and the webclient.war/img/res folder on the machine or machines hosting the Web server. Set the parameter to a bitmap from the system-supplied list (<Choose Calendar Bitmap>) or the default icon (<Default Calendar Bitmap>).

Background Color

Input, required. The color to appear behind the information on the calendar. Set the parameter to a color from the color palette (<Pick Color>) or the default color (<Reset Color>).

Additional Notes

When you add an activity through the system function, Add Calendar Activity, you can affect these aspects of how the activity appears and acts on the calendar:

  • Name of the activity (subject).

  • Start and end day and time.

    The system requires this value in JDEUTime, even when you designate an activity as an all-day activity. You can also flag an activity for reoccurrence.

    If the start and stop times result in a span of time that is greater than or equal to 24 hours, then the system converts the activity to an all day activity. All day activities are displayed in the all day event area in the interface.

  • Additional information associated with the activity.

    You can set values for the type (meeting, appointment, and so forth), the commitment level (low, medium, or high), the activity location, and the activity organizer.

  • Private.

    This option causes the system to display a special icon next to the activity. No other logic is applied automatically, however. If you wish to restrict access to an event marked private, then you must do so within the application.

  • Font, color, and icons.

    You can set the font and related attributes, set a background color, and associate an icon with any activity. The icons from which you have to choose must already reside in the system. To add an icon to the list, save a GIF-type graphic in both of these locations: the B9\<pathcode>\res folder on the machine where FDA is located and the webclient.war/img/res folder on the machine or machines hosting the web server.

Whenever you want to load the calendar with events that exist in a given time period, use this formula:

SELECT from where T2 >= S and T1 <= E

where

  • T2 is the activity end time,

  • S is the system variable, Slstart,

  • T1 is the activity start time, and

  • E is the system variable, Slend.


Delete Calendar Activity

Use this system function to delete an existing activity from the calendar control.

Parameters

Calendar

Input, required. Control: The calendar FC to affect.

Activity ID

Input, required. The ID of the activity to be removed from the calendar. Set the parameter to a parameter to delete all events currently loaded for the control (<Delete All Activities>) or an applicable object from the object list.

Additional Notes

When you delete an activity using this system function, you remove it from the calendar control; you do not remove it from the database. You can choose to delete a single activity or multiple ones. You can also choose to clear the control of all activities.


Modify Calendar Activity

Use this system function to modify an existing event on the calendar control.

Parameters

Calendar

Input, required. The calendar FC to affect.

Activity ID

Input, required. The ID of the activity to be changed on the calendar. Ensure that this value exactly matches the ID (including padding and so forth) as it appears in the table. Set the parameter to an applicable object from the object list.

Subject

Input, required. The title of the activity as it should appear on the calendar for the user. Set the parameter to the current value (<No Change>), an alphanumeric constant (<Literal>) or an applicable object from the object list.

Start Date and Time

Input, required if All Day Activity = False. The starting time and date, in JDEUTime, for the activity. Set the parameter to the current value (<No Change>) or a literal date value in JDEUTime format.

End Date and Time

Input, required if All Day Activity = False. The ending time and date, in JDEUTime, for the activity. Set the parameter to the current value (<No Change>) or a literal date value in JDEUTime format.

All Day Activity

Input, required. The indicator of whether the activity is to be displayed as an all day activity instead of having start and end date and times. Any activity that is equal to or greater than 24 hours automatically becomes an all day activity. All day activities are displayed in the all day activity area in the interface. Set the parameter to the current value (<No Change>), <TRUE>, <FALSE>, or an applicable object from the object list.

Recurrence

Input, required. The indicator of whether the activity occurs more than once. This parameter merely sets a flag; the control displays an icon to indicate that the activity has been flagged as reoccurring, but the system performs no other action in connection with recurrence. Set the parameter to the current value (<No Change>), <TRUE>, <FALSE>, or an applicable object from the object list.

Type

Input, required. The classification of the activity (meeting, appointment, and so forth). This parameter does not appear on the calendar. Set the parameter to the current value (<No Change>), an alphanumeric constant (<Literal>) or an applicable object from the object list.

Commitment Level

Input, required. The relative value of the activity. The value assigned affects the icon displayed and the color of the duration bar for the activity. Set the parameter to the current value (<No Change>), <Low Commitment> (1), <Default> (2), or <High> (3).

Private

Input, required. The indicator of whether to display the "private" icon. Set the parameter to the current value (<No Change>), <TRUE>, <FALSE>, or an applicable object from the object list.

Location

Input, required. The name of the place where the activity is to occur as it should appear on the calendar for the user. Set the parameter to an alphanumeric constant (<Literal>), <N/A>, or an applicable object from the object list.

Organizer

Input, required. The name of the creator of the activity as it should appear on the calendar for the user. Set the parameter to the current value (<No Change>), an alphanumeric constant (<Literal>), <N/A>, or an applicable object from the object list.

Font

Input, required. The font to use to display the activity to the user. Set the parameter to the current value (<No Change>), a font and related settings from the Font dialog (<Pick Font>) or the default font and related settings (<Reset Font>).

Bitmap

Input, required. The bitmap of an icon to display to the user on the calendar in association with the activity. To add an icon to the list, save a GIF-type graphic in both of these locations: The B9\<pathcode>\res folder on the machine where FDA is located and the webclient.war/img/res folder on the machine or machines hosting the Web server. Set the parameter to he current value (<No Change>), a bitmap from the system-supplied list (<Choose Calendar Bitmap>) or the default icon (<Default Calendar Bitmap>).

Background Color

Input, required. The color to appear behind the information on the calendar. Set the parameter to the current value (<No Change>), a color from the color palette (<Pick Color>) or the default color (<Reset Color>).

Additional Notes

When you modify an activity using the system function, Modify Calendar Activity, you can affect these aspects of how the activity appears and acts on the calendar:

  • Name of the activity (subject).

  • Start and end day and time.

    The system requires this value in JDEUTime, even when you designate an activity as an all-day activity. You can also flag an activity for reoccurrence.

    If the start and stop times result in a span of time that is greater than or equal to 24 hours, then the system converts the activity to an all day activity. All day activities are displayed in the all day event area in the interface.

  • Additional information associated with the activity.

    You can set values for the type (meeting, appointment, and so forth), the commitment level (low, medium, or high), the activity location, and the activity organizer.

  • Private.

    This option causes the system to display a special icon next to the activity. No other logic is applied automatically, however. If you wish to restrict access to an event marked private, then you must do so within the application.

  • Font, color, and icons.

    You can set the font and related attributes, set a background color, and associate an icon with any activity. The icons from which you have to choose must already reside in the system. To add an icon to the list, save a GIF-type graphic in both of these locations: the B9\<pathcode>\res folder on the machine where FDA is located and the webclient.war/img/res folder on the machine or machines hosting the web server.

When modifying an event, ensure that the event's ID value exactly matches the ID as it appears in the table. For example, if the table column is left-padded, you must prefix the event ID as it appears in the control with the same number of characters that have been added to the event ID in the table because of the column formatting.

Whenever you want to load the calendar with events that exist in a given time period, use this formula:

SELECT from where T2 >= S and T1 <= E

where

  • T2 is the activity end time,

  • S is the system variable, Slstart,

  • T1 is the activity start time, and

  • E is the system variable, Slend.

Add a Calendar Activity


Select Calendar View

Use this system function to determine which view of the calendar (day, week, or month) to display to the user upon an event trigger.

Parameters

Calendar

Input, required. The calendar FC to affect.

Calendar View

Input, required. The calendar view (day, week, or month) to display to the user. Set the parameter to <Day View > (0), <Week View > (1), or <Month View> (2).