Add

Description

Adds an appointment, contact, or task as a Pocket Outlook entry.

Applies to

POOM objects

Syntax

Integer objectname.Add (entity)

Argument

Description

objectname

The name of the POOM object

entity

Entity of type POOMAppointment, POOMContact, or POOMTask

Returns

Integer. Returns 1 for success and one of the following negative values if an error occurs:

Usage

A user must be logged in to a POOM object to add an appointment, contact, or task. For a POOMTask object, the StartDate property must be set before you call Add. The Body and BodyInk properties cannot be set until after the new object has been added to the repository, but their values are updated in the repository implicitly when either value is set.

Examples

Example 1

The following example adds an appointment to the depository, adds body text, and displays the appointment in the Pocket PC Calendar:

// Global variable: g_poom
integer li_rc
POOMAppointment appt
DateTime  dt
Date ld_date
Time lt_time

appt = CREATE POOMAppointment
appt.Subject = "All Hands"
appt.Location = "Auditorium"

// get the start and end times from EditMasks
ld_date = Date(em_startdate.Text)
lt_time = Time(em_starttime.Text)
dt = DateTime(ld_date, lt_time)
appt.appointmentStart = dt

ld_date = Date(em_enddate.Text)
lt_time = Time(em_endtime.Text)
dt = DateTime(ld_date, lt_time)
li_rc = g_poom.Add( appt )

// Now add the body of the appointment
appt.Body = "Agenda: ~r~n Quarterly results " &
    + "~r~n Success stories" &
    + "~r~n Organizational changes"

// Display the appointment 
appt.display()

See also