appointment Table (9)

Tasks, appointments, followups, phone calls; and documents (document_id != 0). An appointment always has a corresponding record in VisibleFor specifying who may see this.

Fields

NameDescriptionTypeNull
appointment_idPrimary keyPK
contact_idContact ID of owning contact, may be 0FK contact
person_idPerson ID of person the appointment is with, may be 0FK person
associate_idID of associate whose diary the appointment is in, REQUIREDFK associate
group_idxGroup of owning associate at the time tha ppnt was createdFK UserGroup
registeredRegistered dateUtcDateTime
registered_associate_idRegistered by whomFK associate
donedate + start time this task was doneDateTime
do_bydate + start time plannedDateTime
leadtimeTime blocked (minutes) BEFORE starttimeUShort
task_idxLink to Task list, OR to DocTmpl list, if this is a documentFK Task
priority_idxLink to priority listFK Priority
typewhere=no start time,note,docin, docoutEnum AppointmentType
statusstatus=done,started, not started, hiddenEnum AppointmentStatus
privateObsolete, but still maintained field for appointment privacy; denormalization of visiblefor statusEnum AppointmentPrivate
alarmAlarm leadtime, the alarm flag has moved to hasAlarmUShort
text_idID of record containing appointment textFK text
project_idID of project referred to, may be 0FK project
mother_idID of mother appointment; self if booking master, master ID if booking slave, 0 if normal appointment. However, if 0 and assoc_id != reg_id then this is an assigned appointment, indicated vt type = kBookingFK appointment
document_idPoints to document record; 0 for non-document appointments!FK document
color_indexAppointment colour, used only in Japanese versions. Western versions take colour from TaskUShort
invitedPersonIdValid when mother_id != 0 && mother_id != idFK person
activeDateThe date to be used for searching & showingDateTime
endDateDate + end time plannedDateTime
lagTimeas leadtime, but after the end - time blocked for travel etc.UShort
sourceFor future integration use; source of recordUShort
userdef_idUser defined table record 1 (for future use)FK udappntsmall
userdef2_idUser defined table record 2 (for future use)FK udappntlarge
updatedUpdated dateUtcDateTime
updated_associate_idUpdated by whoFK associate
updatedCountNumber of updates made to this recordUShort
activeLinksNumber of active links to documents, other appointments, and suchUInt
recurrenceRuleIdPointer to recurrence rule, for recurring appointments, otherwise 0FK RecurrenceRule
locationLocation for appointment, defaulted from invited resource of type place and other rules, but you can write anything you want hereString(254)
alldayEventIs this an all day event: 0 = No, 1 = YesEnum AllDayEvent
freeBusyWhat kind of time is this: 0 = Busy, 1 = FreeEnum FreeBusy
rejectCounterHow many invitees have rejected this appointmentUShort
emailIdIf invitation and status changes should be mailed, this is the ID of the email address usedFK Email
rejectReasonWhy was this booking or assignment rejected, the RejectReason list is a source of suggestions but you can write anything hereString(254)
hasAlarmDoes this appointment have an alarmBool
assignedByWho (last) assigned this appointment to associate_id?FK associate
preferredTZLocationPreferred timezone location to use when displaying/editing this appointmentFK TZLocation
sale_idOwning sale, if any (may be 0)FK sale
suggestedAppointmentIdSuggested guide item that this appointment is an instance of (Note: NOT VALID for document-type appointments, they have their own link)FK SuggestedAppointment
suggestedDocumentIdSuggested guide item that this document is an instance of (Note: NOT valid for appointments, they have their own link)FK SuggestedDocument
isMilestoneIs this appointment a milestone?Bool
join_videomeet_urlBlank when not a video meeting. Filled with Join Meeting URL when created.String(2000)
centralservice_videomeet_idGUID for video meeting in central services – this is set when we create meetings from SuperOffice. It is blank for incoming meetings created from inbox.String(100)
original_start_dateThe original start date for an appointment in a recurring seriesDateTime
agenda_text_idID of record containing agenda textFK text
internal_notes_text_idID of record containing internal notes textFK text
SendEmailSend invitation and appointment changes by e-mail to this participant.Bool
modified_appointment_fieldsWhich important fields of an appointment have been changed. Used by notifications.Enum ModifiedAppointmentFields
created_by_workflow_idThe workflow this follow-up was created byFK workflow
cautionWarningStatus field to indicate appointments that have some sort of problemEnum AppointmentCautionWarning
mother_associate_idAssociate/owner of the mother appointmentFK associate
owned_externallySet if an external system owns this appointment.Enum AppointmentExternalOwner

appointment table relationship diagram

Values needed to access the appointment tables

This table must contain special values that would be difficult to guess correctly. These are listed below with a description of how to use them.

🛈 Note
Booking means a group reservation where you invite several associates or resources to join.

Appointment Type

| Appointment Type | ID | Comment | |---|---|---| | Undefined | 0 | The appointment type is not defined- used when initializing | | Appointment in Diary |  1 | Show in diary. If overdue or done today, show in checklist also | | Appointment in Check list | 2 | Appointment is a followup with no specific starttime | | Note shown as a paper clip on e.g. contacts | 3 | Paper clip on diary, expands to "post-it" note when clicked | | Incoming Document | 4 | Document | | Saved report | 5 | Saved Report (i.e., not a Report Definition but the result of an actual report run) | | Booking, made for diary | 6 | When accepted this will change type = 1 | | Booking, made for check list | 7 | When accepted this will change type = 2 | | Document - mail merge draft | 8 | Document is a template for mailmerge operations | | Document - mail merge final | 9 | Document is a result of a mailmerge operations (there are probably many documents like this!) |

Status type

| Status type | ID | Comment | |---|---|---| | Appointment type is a Post-IT | 0 | Unknown / Appointment is a Post-IT, used together with ApointmentType.Note only | | Not started | 1 | Resources and mother appointments get this status on new appointments, implies the green mark for accepted | | Started | 2 | Marked when the appointment is actually started, but not completed | | Completed | 3 | Completed is set to avoid changes to the appointment | | Hidden | 4 | Appointment is hidden | | Booking | 5 | Appointment is a booking invitation (initial status for a booking) | | Booking has moved | 6 | You may have seen, declined, or accepted the booking, but it has been moved, so you will be asked again. | | Booking seen | 7 | You have seen the booking, but not declined or accepted it. | | Booking moved seen | 8 | The booking has been moved and you have seen the change, but not declined or accepted it. | | Booking declined | 9 | You have declined the booking. | | Booking deleted | 10 | Status of "child" appointment whose "mother" has been deleted (the meeting is canceled) | | Assignment | 11 | You are assigned this appointment (initial status, like Booking(5) ) | | Assignment seen | 12 | You have seen the assignment, but not accepted or declined it | | Assignment declined | 13 | You have declined the appointment assigned to you. |

Private

| Private Type | ID | Comment | |---|---|---| | Public appointment | 0 | This appointment can be read by anyone | | Private appointment | 1 | This appointment can only be read/seen by the owner | | Private appointment | 2 | This appointment can only be read by members in my group/dept |

Task_idx

Is either template_idx (DocTmpl_id in DocTmpl) or task_idx (Task_id in Task), depending on the type value.

| Type | Task_Idx | Status | |---|---|---| | Appointment in diary | task_idx | 1 = not started, 2 = started, 3 = done | | Appointment in check list | task_idx | 1 = not started, 2 = started, 3 = done | | Booking, made for diary | task_idx | booking (mother_id > 0) | | Booking_made for check list | task_idx | booking (mother_id > 0) | | Note – post it | | | | Document in | template_idx | 1 = not started, 2 = started, 3 = done |

Mother_id

| mother_id | appointment_id | Comment | |---|---|---| | 0 | | This is a simple appointment | | > 0 | mother_id = appointment_id | This is a booking, and the appointment is the master booking (the one that is inviting) | | > 0 | mother_id not like appointment_id | This is a booking, and the appointment is the slave booking (someone who is invited) |

Bookings share a single text record. In SuperOffice the person doing the inviting is the only one allowed to change the text of this booking (appointment). A booking may have associate_id = 0, if it is an invitation to an external attendee; in that case the InvitedPersonId is the person ID of the attendee. Person_id is always the ID of the person the meeting is with (not of the person who is invited to it).

FreeBusy

| FreeBusy Type | ID | Comment | |---|---|---| | Busy | 0 | This appointment is marked as busy in the diary | | Free | 1 | This appointment is marked as free in the diary |

Documents linked to an appointment are linked in the Relations table. There is no special marking in appointment so always check if the active appointment has valid entries in the Relations table. The relationdefinition table holds the reldef_id for "Link to follow-up", "Link to document", and "Link to sale". Our GUI currently only supports links to documents.

To assign an appointment to someone

Dim apt As IAppointment = so.Database.CreateAppointment()
apt.SetDefaults()
apt.Type = 1 ' or 2
apt.Status = 11
apt.AssignedBy = mamagersId
apt.Person = so.Database.GetPerson(11)
apt.Contact = so.Database.GetContact(3)
apt.Project = so.Database.GetProject(4)
apt.Task = so.Database.GetListItem(SOTableId.enTableTask, 1)
apt.Save()

Accepting an appointment

Dim apt As IAppointment = so.Database.GetAppointment(120)
apt.AcceptInvitation(EnResponse.enResponseAccept)

 ' set status from 11 to 1
 ' set assignedBy = associate-id (WARNING: This may change in the future)

Rejecting an appointment

  • set status = 13
  • set associate-id = assigned-by

To create an invitation to an appointment

  • Create a second appointment as copy of first.
  • Appnt.Mother_id = appnt.appnt_id
  • Appnt.invitedPerson = appnt.associate-id's person-id
  • Appnt2.Mother_id = appnt.appnt_id
  • Appnt2.Associate_id = invited user
  • Appnt2.invitedPerson = invited user's
  • Appnt2.type = 6 or 7
  • Appnt2.status = 5

On the whole it is best to use the functions on the Appointment object to do this sort of thing:

  • SoAppointment.AcceptInvitations
  • SoAppointment.AddParticipant
  • SoAppointment.RemoveParticipant

Indexes

FieldsTypesDescription
appointment_idPKClustered, Unique
contact_idFKIndex
person_idFKIndex
group_idxFKIndex
doneDateTimeIndex
do_byDateTimeIndex
text_idFKIndex
project_idFKIndex
mother_idFKIndex
document_idFKIndex
activeDateDateTimeIndex
sourceUShortIndex
userdef_idFKIndex
userdef2_idFKIndex
sale_idFKIndex
suggestedAppointmentIdFKIndex
suggestedDocumentIdFKIndex
project_id, typeFK, EnumIndex
contact_id, typeFK, EnumIndex
associate_id, type, status, doneFK, Enum, Enum, DateTimeIndex
associate_id, type, status, do_byFK, Enum, Enum, DateTimeIndex
associate_id, type, endDate, do_byFK, Enum, DateTime, DateTimeIndex
associate_id, type, status, activeDateFK, Enum, Enum, DateTimeIndex
recurrenceRuleId, activeDate, associate_idFK, DateTime, FKIndex
recurrenceRuleId, activeDate, mother_idFK, DateTime, FKIndex
associate_id, activeDate, mother_id, appointment_idFK, DateTime, FK, PKUnique
mother_id, status, activeDate, registered_associate_id, registered, assignedBy, group_idx, type, associate_id, appointment_idFK, Enum, DateTime, FK, UtcDateTime, FK, FK, Enum, FK, PKUnique
project_id, type, activeDate, document_id, associate_id, group_idx, mother_id, assignedBy, appointment_id, registered, registered_associate_idFK, Enum, DateTime, FK, FK, FK, FK, FK, PK, UtcDateTime, FKUnique
agenda_text_idFKIndex
type, activeDateEnum, DateTimeIndex
created_by_workflow_idFKIndex
associate_id, status, do_by, endDateFK, Enum, DateTime, DateTimeIndex

Relationships

TableDescription
appointmentTasks, appointments, followups, phone calls; and documents (document_id != 0). An appointment always has a corresponding record in VisibleFor specifying who may see this.
associateEmployees, resources and other users - except for External persons
contactCompanies and Organizations.
documentDocuments, this table is an extension of the Appointment table. There is always a corresponding appointment record; the relation between appointment and document is navigable in both directions. A document-type appointment record always has a corresponding document record and a record in VisibleFor specifying who may see this.
EmailEmail addresses for contacts, projects and persons
email_itemEmail data
invitationInvitations to events
personPersons
PriorityPriority list table. Used with appointments: low, high.
projectProjects
QuoteVersionThere may be multiple Versions of a Quote, with one of them active
RecurrenceRuleThe recurrency pattern for a recurring event. Each recurring event has an appointment.recurrenceRuleId pointing to its pattern.
saleSales For every Sale record edited through the SuperOffice GUI, a copy of the current version of the record will be saved in the SaleHist table. This also applies to editing done through the SaleModel COM interface, but not to editing done through the OLE DB Provider or other channels.
SaleHistMirror image of the Sale table, providing a full transaction history. Every time you edit a sale, the current record of the sale is also saved here.
SuggestedAppointmentDefines a suggested appointment for use in a Sale Guide or Project Guide
SuggestedDocumentUnique owner of a set of licensed modules
TaskTask list table, activity types, like Phone, Meeting
textLong text fields from all over the system
TZLocationTime zone location
udappntlargeUser-defined fields
udappntsmallUser-defined fields
UserGroupSecondary user groups
VisibleForVisible for rights, who may see this appointment/document, sale, salehist or selection
workflowSuperOffice specific info about a workflow

Replication Flags

  • Area Management controlled table. Contents replicated to satellites and traveller databases.
  • Replicate changes UP from satellites and travellers back to central.
  • Copy to satellite and travel prototypes.
  • Cache table during filtering.

Security Flags

  • Sentry controls access to items in this table using user’s Role and data rights matrix.
  • Visibility controlled via matching VisibleFor row.