Manual event scheduling with workflows

It is possible to manually enter the information needed to create Scheduled Event records. This works by having people use the Event form to create an Event record and then using an action on another form to launch a workflow that performs a SCHEDULE action on the Event record.

Instead of designing applications to create Scheduled Event records this way, use the Event form because it offers more options for the scheduling and recurrence of events. Some of the options may be inappropriate or confusing for some applications.

To avoid having to train people about event scheduling options they do not need and to avoid people choosing event scheduling options that are inappropriate for an application, provide an application-specific form.

Here is an outline of the things involved in manually entering event scheduling information:
At design time:

Define an association between the Event business object and the business object used to create the records for which you want to create Scheduled Event records. Both sides of the association should be named Scheduled.

To the form used to edit the records that events should be scheduled for, you must add a way to create and edit an associated Event record. The simplest way to do this is to add a single-record smart section to the business object that underlies the form.

You will need a way to perform a SCHEDULE action on the associated Event record. The simplest way to do this is to write a one task synchronous workflow that is launched from a form and performs a SCHEDULE action on the associated Event record.

At runtime:

The person who wants to associate Scheduled Event records with another record creates and edits the associated Event record, specifying when the event should happen, the event's duration, if the event should be repeated and when the event should be repeated.

When the scheduling information is correctly entered, the person must click whatever has been provided to perform a SCHEDULE action on the Event record. Performing the SCHEDULE action on the Event record causes the Scheduled Event records to be created and associated with the same record associated with the Event record.

Having outlined these activities, we describe some of them in greater detail.

Use the Association Manager to define the association named Scheduled between the Event business object and the other business object. The associations and the Association Manager are described in Association definition.

Smart sections are described in Record organization.

If the Event record is accessed through a single-record smart section, the simplest way to provide an action for performing a SCHEDULE action on Event records is to add the action to the smart section in the form that is used to access the single-record smart section.

It is easiest to first create the simple workflow that will perform a SCHEDULE action on the associated Event record before adding an action to a form to launch the workflow. In the Workflow Editor, the workflow could look like the following figure. Like all workflows, this workflow has a Start task and an End task which do not do anything. Between them is a Trigger Action workflow task that triggers the SCHEDULE action.
Figure 1. SCHEDULE workflow
The image is explained in the text.
The properties for the workflow's Start task will look like the following figure. The most important thing to notice about the settings in the following figure is that the Module and Object Type fields specify the business object used to create records that contain the single-record smart section.
Figure 2. SCHEDULE workflow properties
The image is explained in the text.
The properties for the Trigger Action task labeled Trigger SCHEDULE are shown in the following figure. Notice the following things about the settings:
  • The action that the task will perform is specified in the Action field as SCHEDULE. It will perform the SCHEDULE action on the Event record referenced by the Event single-record smart section.
  • The Records section of the workflow task's properties specifies that to find the record to perform the action on, the task should begin with the record associated with the Start task. This is the record that contains the smart section. It is the target record for the Records section.
Figure 3. SCHEDULE workflow Trigger Action properties
The image is explained in the text.

The Records section also specifies that the action should be performed on the record referenced by the target record's Event record section.

After the workflow is created, the next thing to do is add an action to the form's smart section to launch the workflow. Adding an action to a form's smart section is discussed in Smart section actions.

Having discussed these design-time activities, we are now ready to discuss what a user needs to do at runtime to schedule an event using the Event form.

The form for a new Event record initially looks like the following figure.
Figure 4. Event form, Event tab
The image is explained in the text.

Begin filling out this form by supplying values for the fields in the Event Info section.

The Subject field can be used to enter a brief comment about the purpose of the event.

The Event Type field allows a person to select a value that workflows may use to distinguish between different kinds of events. This field's drop-down list may contain values that are appropriate for some applications but not others. The items in the drop-down list are managed by the List Manager under the name Event Type.

A person should set the value of the Event Start Date field to the time and date when the event will be scheduled to start. If the event will be recurring, the date portion of this field will be used to determine the earliest start date, not the actual start date. The actual date(s) when the event will occur will be determined by the recurrence information instead.

The default value for this field is the current time and date. For most events, this is not a useful default.

The Event Duration field may be filled in with the duration of the event.

After you have finished entering values into the fields of the Event Info section, the next thing to do is select one of the Recurrence Pattern Type radio buttons. The portion of the form below the Recurrence Type section varies, depending on which of these radio buttons you select.
Manually Scheduling a Single Occurrence
Selecting the Single Occurrence radio button means that the event will occur just at the one date and time specified by the Event Start Date field.
Manually Scheduling a Daily Occurrence

Selecting the DAILY radio button means that the event will recur with a frequency measured in days. It will recur after the number of days specified in the Recur Every ___ Day(s) field has elapsed. For example, if the value of the Recur Every ___ Day(s) field is 2 then the event will recur every other day.

Use the Weekday and Weekend Day check boxes to define whether the event will recur on just weekdays (i.e., Monday through Friday), weekend days (i.e., Saturday and Sunday), or both.

The event will continue to recur until it has completed the number of occurrences specified in the End After ___ Occurrences field. If no value is specified in the End After ___ Occurrences field, the event will continue recurring forever.

If an event recurs, a Scheduled Event record will be created for each recurrence. However, these Scheduled Event records may not be generated all at the same time. Instead, just the next few Scheduled Event records that are needed are generated. The exact number that will be generated is determined by the value of the Generate __ Day(s) of Events (rolling) field.

After the first of the scheduled events happens, another Scheduled Event record is created. This keeps the number of pre-generated Scheduled Event records at the number specified by the Generate __ Day(s) of Events (rolling) field. Once the number of remaining scheduled events for the recurrence specified falls below the Generate ___ Day(s) of Events (rolling) field value, the system stops generating additional Scheduled Event records.

In the Exclude Dates section, specify ranges of dates. During these ranges of dates, the event will not recur.

Manually Scheduling a Weekly Occurrence

Selecting the WEEKLY radio button means that the event will recur with a frequency measured in weeks. It will recur after the number of weeks specified in the Recur Every ___ Week(s) On field has elapsed. For example, if the value of the Recur Every ___ Week(s) On field is 2 then the event will recur every other week.

On weeks when the event occurs, it will happen on the days of the week that correspond to the checked check boxes in the Weekly Recurrence section.

The event will continue to recur until it has completed the number of occurrences specified in the End After ___ Occurrences field. If no value is specified in the End After ___ Occurrences field, the event will continue recurring forever.

If an event recurs, a Scheduled Event record will be created for each recurrence. However, these Scheduled Event records may not be generated all at the same time. Instead, just the next few Scheduled Event records that are needed are generated. The exact number that will be generated is determined by the value of the Generate __ Week(s) of Events (rolling) field.

After the first of the scheduled events happens, another Scheduled Event record is created. This keeps the number of pre-generated Scheduled Event records at the number specified by the Generate __ Week(s) of Events (rolling) field. Once the number of remaining scheduled events for the recurrence specified falls below the Generate ___ Week(s) of Events (rolling) field value, the system stops generating additional Scheduled Event records.

In the Exclude Dates section you can specify ranges of dates. During these ranges of dates, the event will not recur.

Manually Scheduling a Monthly Occurrence

Selecting the MONTHLY radio button means that the event will recur with a frequency measured in months. It will recur after the number of months specified in the Recur Every ___ Month(s) On field has elapsed. For example, if the value of the Recur Every ___ Month(s) On field is 2 then the event will recur every other month.

The day of the month on which the event happens can be determined by one of three methods. If it is desired to have the event occur on a specific numbered day of the month, the Day of month (1-31) field value can be set. For example, if the value of the Day of month (1-31) field is 2, the event will happen on the second day of the month.

If the value in the Day of month (1-31) field is 29, 30, or 31 and a recurrence falls in a month that does not have that many days, the event happens on the last day of the month. So, if you want an event to be repeated on the last day of every month, specify 31 for the value of the Day of month (1-31) field.

Alternately, the day of the month on which the event happens can be determined by setting the Week of month or Day of Week value. Setting a value for Week of month instructs the system to have the event happen on the week number selected. The Day of Week value defines which day of the week the event happens for the week selected in the Week of month field.

The event will continue to recur until the date specified in the End After ___ Occurrences field. If there is no value specified in the End After ___ Occurrences field, the event will continue recurring forever.

If an event recurs, a Scheduled Event record will be created for each recurrence. However, these Scheduled Event records may not be generated all at the same time. Instead, just the next few Scheduled Event records that are needed are generated. The exact number that will be generated is determined by the value of the Generate __ Month(s) of Events (rolling) field.

After the first of the scheduled events happens, another Scheduled Event record is created. This keeps the number of pre-generated Scheduled Event records at the number specified by the Generate __ Month(s) of Events (rolling) field. Once the number of remaining scheduled events for the recurrence specified falls below the Generate ___ Month(s) of Events (rolling) field value, the system stops generating additional Scheduled Event records.

Specify ranges of dates in the Exclude Dates section. During these ranges of dates, the event will not recur.

Manually Scheduling a Yearly Occurrence

Selecting the YEARLY radio button means that the event will recur every year. It will recur in the month specified by the Recur Every ___ Year(s) On field on the day specified in the Day of Month (1-31) field.

The event will continue to recur until it has completed the number of occurrences specified in the End After ___ Occurrences field. If no value is specified in the End After ___ Occurrences field, the event will continue recurring forever.

If an event recurs, a Scheduled Event record will be created for each recurrence. However, these Scheduled Event records may not be generated all at the same time. Instead, just the next few Scheduled Event records that are needed are generated. The exact number that will be generated is determined by the value of the Generate __ Year(s) of Events (rolling) field.

After the first of the scheduled events happens, another Scheduled Event record is created. This keeps the number of pre-generated Scheduled Event records at the number specified by the Generate __ Year(s) of Events (rolling) field. Once the number of remaining scheduled events for the recurrence specified falls below the Generate ___ Year(s) of Events (rolling) field value, the system stops generating additional Scheduled Event records.

In the Exclude Dates section you can specify ranges of dates. During these ranges of dates, the event will not recur.

Manually Scheduling an Ad Hoc Occurrence
Selecting the Ad Hoc radio button means that the event will recur but with no particular pattern. In addition to the event happening on the date specified by the Event Start Date field, it will also happen on the dates you specify in the Also Schedule On section.

Sometimes you may have multiple events fall on the same day and want just one of the events to happen, not all of them. For example, there may be a weekly event for shampooing the carpet in a hallway. There also may be an annual event to paint the hallway. You do not want the rug shampooing to happen when it would coincide with the painting. There is a feature called event shadowing that controls things like this.

There are two steps to make one event shadow another. The first is to put the event that has priority in the Shadowing Events section of the other. In the example, you would put the painting event in the Shadowing Events section of the rug shampooing event. The other step is to supply a value for the OffsetDate Duration (for Shadowing) field.

An event is shadowed if another event referenced in its Shadowing Events section occurs within the number of days specified by the value of the OffsetDate Duration (for Shadowing) field. If you did not want the rug shampooing to happen if it is scheduled within two days of a painting event, then you would set the value of the rug shampooing event's OffsetDate Duration (for Shadowing) field to 2.