Working with meetings and appointments

The following techniques apply specifically to calendar events and the notices about meetings that you get in your mail Inbox:

  • How to get detailed information about meeting requests, cancellation notices, and responses to invitations
  • How to specify event recurrence

Working with meeting notices and requests

Your mailbox gets a meeting notice when someone takes any of the following actions:

  • Sends you a meeting request
  • Cancels a meeting in your calendar
  • Responds to a meeting request that you sent and tells Exchange to notify you
    The information provided by the cfexchangemail tag with the get action does not provide detailed information about meeting. It only includes the following meeting-related information:
  • The event UID
  • The type of message type: a meeting request, response, or cancellation
  • If the message is a response to a meeting request, an indication whether the meeting was accepted, declined, or tentatively accepted
    Also, a meeting request does not appear in your calendar (so you cannot get detailed information about it using the cfexchangecalendar tag) until you accept it.
    To get detailed information about a meeting message, use the cfexchangemail tag with the getMeetingInfo action. After getting the information, you can take the necessary action, such as using an cfexchangecalendar tag with the response action to accept or decline a meeting request.
Get meeting message details and respond to meeting requests
  1. Get the mail messages that contain the meeting notifications by using a cfexchangemail tag with an action attribute value of get and a cfexchangefilterchild tag with the following attributes:
    • A name attribute with a value MessageType
    • A value attribute with a value of Meeting, Meeting_Request, Meeting_Response, or Meeting_Cancel. A value of Meeting gets all meeting notifications.
      You can use additional cfexchangefilter tags to further limit the messages you get.When the cfexchangemail tag completes processing, the MeetingUID column of the structure specified by the cfexchangemail tag name attribute contains the UIDs of the meetings.
  2. For each meeting, get the information about the meeting by using a cfexchangemailtag with the following attributes:
    • An action attribute value of getMeetingInfo.
    • A meetingUID attribute value with the value from the MeetingUID column of the structure specified by the cfexchangemail tag name attribute.
    • (Optional) A mailuid attribute with the UID of the message that contained the meeting notification. Use this attribute to identify a specific message if the Inbox contains multiple messages about a single meeting.
  3. Use the information returned in step 2 in application-specific logic to determine the required messages and actions. For example, you could display all meeting requests in a form that lets a user submit a response to each message.
  4. To respond to a meeting request, use the cfexchangecalendar tag with an action value of respondand set the following the attributes:
    • Set the uid attribute to the Meeting UID you received in step 2. Do not use the Message UID.
    • Specify a responseType value of accept, decline, or tentative.
    • (Optional) Specify a notify value of true (the default value) or false to control whether the event owner receives a meeting response message.
    • If the owner receives a notification, you can also specify a message attribute with a text message that is included in the response.
      The following example shows how you can use this process. It displays all meeting invitations in the Inbox and lets the user respond to each request and send a message with the response:

action="open"
username ="#user2#"
password="#password2#"
server="#exchangeServerIP#"
connection="conn1">

<cfif isDefined("Form.Submit")>

<!--- When the form has been submitted, send the responses. --->
<cfloop index="k" from="1" to="#Form.responses#">
<cfset resp = Form["response" & k] >
<cfset msg = Form["respMessage" & k] >
<cfset msguid = Form["UID" & k] >
<cfexchangecalendar action="respond" connection="conn1"
uid="#msguid#" responseType="#resp#" message="#msg#">
<cfoutput><h4>Response #k# sent!</h4></cfoutput>
</cfloop>

<cfelse>
<!--- Get all messages with meeting Requests. --->
<cfexchangemail action="get" name="requests" connection="conn1">
<cfexchangefilter name="MessageType" value="Meeting_Request">
</cfexchangemail>

<!--- Get the meeting request data. --->
<cfloop query="requests">
<cfexchangemail action="getmeetinginfo" connection="conn1"
name="meeting" meetinguid="#MeetingUID#">
<cfset meetingData[requests.currentrow]=meeting>
</cfloop>

<!--- Display the invitation data in a form. --->
<cfform name="bar">
<cfloop index="j" from="1" to="#ArrayLen(meetingData)#">
<cfoutput>
<h3>Meeting Request #j#</h3>
Subject: #meetingData[j].Subject# <br />
Sensitivity: #meetingData[j].Sensitivity# <br />
Organizer: #meetingData[j].Organizer# <br />
All Day?: #meetingData[j].AllDayEvent# <br />
Day: #DateFormat(meetingData[j].StartTime)#&nbsp;&nbsp;
Starts: #TimeFormat(meetingData[j].StartTime)#&nbsp;&nbsp;
Ends: #TimeFormat(meetingData[j].EndTime)# <br />
Duration: #meetingData[j].Duration# <br />
Location: #meetingData[j].Location# <br />
Message: #meetingData[j].Message# <br />
</cfoutput>

<!--- Specify the response to this invitation. --->
<h4>response:</h4>
<cfinput type="radio" checked name="response#j#" value="accept">
Accept
<cfinput type="radio" name="response#j#" value="decline">Decline
<cfinput type="radio" name="response#j#" value="tentative">Tentative
<br />
<cftextarea name="respMessage#j#" label="Message (optional)"
width="300" height="200" />
<cfinput type="hidden" name="UID#j#"
value="#meetingData[j].MeetingUID#">
<hr />
</cfloop>
<cfinput type="hidden" name="responses"
value="#ArrayLen(meetingData)#">
<cfinput type="Submit" name="submit" value="Submit">
</cfform>

</cfif>

<cfexchangeconnection
action="close"
connection="conn1">

For an example that gets information about all declined meeting messages in the Inbox and all its subfolders, see the example in Getting and using folder names in Getting Exchange items and attachments.

Specifying Calendar recurrence

To create an event that recurs multiple times, you specify the following fields in the event attribute structure:

  • Set the IsRecurring field to true.
  • Specify a RecurrenceType field value of DAILY, WEELY, MONTHLY, or YEARLY.
  • (Optional) Specify one of the following mutually exclusive fields: RecurrenceCount, RecurrenceEndDate, or RecurrenceNoEndDate.

    Note: If you omit all three of these fields, the event is created with no end date, and if you specify a count or end date, the RecurrenceNoEndDate value is automatically false; therefore, Specify a RecurrenceNoEndDate field only if you are changing an existing event with a recurrence count or end date to one with no end date.

     

  • Specify the recurrence details in additional fields that depend on the recurrence type.
    To change an event recurrence, including to change whether the event recurs, you specify only the fields whose values change. To stop an event from recurring, set the IsRecurring field to false. To convert an event from nonrecurring to recurring, set the IsRecurring field to true and set all the necessary recurrence fields.
    The following sections describe how to specify each type of recurrence. For detailed descriptions of the fields that you use, see cfexchangecalendar in the CFML Reference.

Note: If you specify a recurrence rule that conflicts with the start date that you specify, the first occurrence of the event is on first day following the start date that conforms to the rule, not on the start date. For example, if you schedule an event for the second Tuesday of the month, and specify a start date of June 2, 2007, the first occurrence of the event is on June 12, 2007.

Specifying daily recurrence

To set a recurrence that is based on days, you do one of the following:

  • Define a RecurrenceFrequency field to specify the frequency of the event, in days. To schedule a meeting for every third day, for example, specify RecurrenceFrequency="3".
  • Specify RecurEveryWeekDay="true" to specify a meeting that is held five days a week.
    You cannot use daily recurrence to schedule a single event that occurs a multiple number of times, but only on week days. To schedule such an event, specify a weekly recurrence with multiple recurrence days.
    The following CFScript code sample sets daily recurrence for every three days and sets the event to occur 20 times:

RecurrenceType="DAILY";
RecurrenceCount="20";
RecurrenceFrequency="3";

Specifying weekly recurrence

You can create an event that always occurs on the same day or days of the week, and occurs every week or every several weeks by specifying RecurrenceType="WEEKLY". You use the following fields to control the frequency:

  • Define a RecurrenceFrequency field to specify the frequency of the event, in weeks. If you omit this field, the event occurs every week. To schedule a meeting for every fourth week, for example, specify RecurrenceFrequency="4".
  • Specify a RecurrenceDays field with a comma-delimited list of one of more of the following strings: MON, TUE, WED, THUR, FRI, SAT, SUN. If you omit this attribute, the event recurs on the day of the week determined by the startTime field value.
    The following CFScript code sample sets an event that occurs on Tuesday and Thursday of every other week until December 3, 2007.

RecurrenceType="WEEKLY";
RecurrenceEndDate="12/13/2007";
RecurrenceFrequency="2";
RecurrenceDays="TUE,THU;

Specifying monthly recurrence

You can create an event that always occurs on a monthly basis, or occurs every several months by specifying RecurrenceType="MONTHLY". You can schedule two types of events:

  • Events that occur on the same date of each scheduled month, for example, on the tenth day of every three months.
  • Events that occur on the same week of the month and the same day of the week, for example, on the second thursday of every month, or on the last Friday of every six months.
    To specify a date-based monthly event, you only specify the recurrence type, and, if the recurrence is not every month, the frequency. ColdFusion schedules the event to occur on the day of the week determined by the startTime field value. To schedule a meeting that occurs on the start date every four months, specify the following recurrence fields:

RecurrenceType="MONTHLY";
RecurrenceFrequency="4";

To specify an event that occurs on the same day of the week, specify the following fields in addition to RecurrenceType:

Field

Description

RecurrenceFrequency

The frequency of the event, in months. If you omit this field, the event occurs every month.

RecurrenceWeek

The week of the month on which the event occurs. Valid values are first, second, third, fourth, and last.

RecurrenceDay

The day of the week on which the event occurs. Valid values are SUN, MON, TUE, WED, THU, FRI, and SAT.

The following CFScript code sample sets an event that occurs on the third Thursday of every three months:

RecurrenceType="Monthly";
RecurrenceFrequency="3";
RecurrenceWeek="third";
RecurrenceDay="THU";

Specifying yearly recurrence

You can create an event that always occurs on a yearly basis by specifying RecurrenceType="YEARLY". You can schedule two types of events:

  • Events that occur on the same date of each year, for example, on every August 10.
  • Events that occur on a specific day week and month, for example, on the second Thursday of August.
    To specify a date-based yearly event, you only specify the recurrence type. ColdFusion schedules the event to occur each year on the date determined by the startTime field value. To schedule a meeting that occurs on the start date every year, specify the following recurrence fields:

RecurrenceType="YEARLY";

To specify an event that occurs on the same day of the week and month each year, specify the following fields in addition to RecurrenceType:

Field

Description

RecurrenceMonth

The month of the year which the event occurs. Valid values are JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, and DEC.

RecurrenceWeek

The week of the month during which the event occurs. Valid values are first, second, third, fourth, and last.

RecurrenceDay

The day of the week on which the event occurs. Valid values are SUN, MON, TUE, WED, THU, FRI, and SAT.

The following CFScript code sample sets an event that occurs on the third Thursday of August three months:

RecurrenceType="YEARLY";
RecurrenceMonth="AUG";
RecurrenceWeek="third";
RecurrenceDay="THU";

Example: Setting calendar recurrence

The following example lets you create events with all types of recurrence. To limit the code length, it does not prevent you from attempting to create events with invalid field combinations. When you submit the form, if an event is created, the form redisplays, preceded by a dump that shows the field values that were used to create the event, and the event UID. You cannot resubmit the form to modify the event, but you can change some values in the form and create an event.

<cfparam name="form.eventID" default="0">

<!--- If the form was submitted, populate the event structure from it. --->
<cfif isDefined("Form.Submit")>
<cfscript>
sEvent.AllDayEvent="false";
sEvent=StructNew();
sEvent.Subject=Form.subject;
if (IsDefined("Form.allDay")) {
sEvent.AllDayEvent="true";
sEvent.StartTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), 8, 0, 0);
}
else {
sEvent.StartTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), Hour(Form.startTime), Minute(Form.startTime), 0);
sEvent.EndTime=createDateTime(Year(Form.date), Month(Form.date),
Day(Form.date), Hour(Form.endTime), Minute(Form.endTime), 0);
}
sEvent.Location=Form.location;
sEvent.RequiredAttendees=Form.requiredAttendees;
sEvent.OptionalAttendees=Form.optionalAttendees;
//sEvent.Resources=Form.resources;
if (Form.reminder NEQ "") {
sEvent.Reminder=Form.reminder;
}
else {
sEvent.Reminder=0;
}
sEvent.Importance=Form.importance;
sEvent.Sensitivity=Form.sensitivity;
//Recurrence Fields
if (IsDefined("Form.isRecurring")) {
sEvent.IsRecurring="true";}
if (IsDefined("Form.recurrenceNoEndDate")) {
sEvent.RecurrenceNoEndDate="true";}
if (Form.recurrenceCount NEQ "") {
sEvent.RecurrenceCount=Form.recurrenceCount;}
if (Form.recurrenceEndDate NEQ "") {
sEvent.RecurrenceEndDate=createDateTime(Year(Form.recurrenceEndDate),
Month(Form.recurrenceEndDate), Day(Form.recurrenceEndDate), 0, 0,
0);}
sEvent.RecurrenceType=Form.recurrenceType;
if (Form.recurrenceFrequency NEQ "") {
sEvent.recurrenceFrequency=Form.recurrenceFrequency;}
if (IsDefined("Form.recurEveryWeekDay")) {
sEvent.RecurEveryWeekDay="true";}
if (Form.recurrenceDays NEQ "") {
sEvent.RecurrenceDays=Form.recurrenceDays;}
if (Form.recurrenceDay NEQ "") {
sEvent.RecurrenceDay=Form.recurrenceDay;}
if (Form.recurrenceWeek NEQ "") {
sEvent.RecurrenceWeek=Form.recurrenceWeek;}
if (Form.recurrenceMonth NEQ "") {
sEvent.RecurrenceMonth=Form.recurrenceMonth;}

sEvent.message=Form.Message;
</cfscript>

<cfdump var="#sEvent#">

<!--- Create the event in Exchange. --->
<cfexchangecalendar action="create"
username ="#user1#"
password="#password1#"
server="#exchangeServerIP#"
event="#sEvent#"
result="theUID">
<!--- Output the UID of the new event --->
<cfif isDefined("theUID")>
<cfoutput>Event Added. UID is#theUID#</cfoutput>
<cfset Form.eventID = theUID >
</cfif>
</cfif>

<cfform format="xml" preservedata="true" style="width:500" height="700">
<cfinput type="text" label="Subject" name="subject" style="width:435">
<br />
<cfinput type="checkbox" label="All Day Event" name="allDay">
<cfinput type="datefield" label="Date" name="date" validate="date"
style="width:100">
<cfinput type="text" label="Start Time" name="startTime" validate="time"
style="width:100">
<cfinput type="text" label="End Time" name="endTime" validate="time"
style="width:100"><br />
<cfinput type="text" label="Location" name="location"
style="width:435"><br />
<cfinput type="text" label="Required Attendees" name="requiredAttendees"
style="width:435"><br />
<cfinput type="text" label="Optional Attendees" name="optionalAttendees"
style="width:435"><br />
<cfinput type="text" label="Resources" name="resources"
style="width:435"><br />
<cfinput type="text" label="Reminder (minutes)" validate="integer"
name="reminder" style="width:200">
<cfselect name="importance" label="Importance" style="width:100">
<option value="normal">Normal</option>
<option value="high">High</option>
<option value="low">Low</option>
</cfselect>
<cfselect name="sensitivity" label="Sensitivity" style="width:100">
<option value="normal">Normal</option>
<option value="company-confidential">Confidential</option>
<option value="personal">Personal</option>
<option value="private">Private</option>
</cfselect>
<hr />
<!--- Recurrence Information --->
<cfinput type="checkbox" label="IsRecurring" name="isRecurring">
<cfinput type="checkbox" label="RecurrenceNoEndDate" name="noEndDate">
<cfinput type="text" label="RecurrenceCount" validate="integer"
required="false" name="recurrenceCount">
<cfinput type="text" label="RecurrenceEndDate" validate="date"
required="false" name="recurrenceEndDate">
<cfselect name="RecurrenceType" label="Recurrence Type"
style="width:100">
<option value="DAILY">Daily</option>
<option value="WEEKLY">Weekly</option>
<option value="MONTHLY">Monthly</option>
<option value="YEARLY">Yearly</option>
</cfselect>
<cfinput type="text" label="RecurrenceFrequency" validate="integer"
name="recurrenceFrequency">
<cfinput type="checkbox" label="RecurEveryWeekDay"
name="recurEveryWeekDay">
<cfinput type="text" label="RecurrenceDays" name="recurrenceDays">
<cfinput type="text" label="RecurrenceDay" name="recurrenceDay">
<cfselect name="RecurrenceWeek" label="RecurrenceWeek" style="width:100">
<option value=""></option>
<option value="first">First</option>
<option value="second">Second</option>
<option value="third">Third</option>
<option value="fourth">Fourth</option>
<option value="last">Last</option>
<cfinput type="text" label="RecurrenceMonth" name="recurrenceMonth">
</cfselect>
<hr />
<cfinput type="textarea" label="Message" name="message" style="width:300;
height:100">
<cfinput type="Submit" name="submit" value="Submit" >
</cfform>

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online