Working with follow-ups (appointments) in API

Follow-ups are the foundation of the SuperOffice diary. These entities are always tied to an associate and have some form of time reference.

Follow-ups are part of a broader group of entities labeled activities:

When working with follow-ups, data will often intersect with the following entities:

Owner

Associate acts as the owner of the follow-up. If you don’t assign an associate to the Associate property of the appointment, the current user will become the owner of the appointment and only one row will be added to the appointment table when the appointment is saved.

Create appointments

You can create an appointment at multiple levels of NetServer, for example web services and in CRMScript. For other options, see the linked “working with” sections at the bottom of this page.

Invitations

When two appointments have a shared text record and different status values it can be called an invitation.

Examples

Recurrence

A repeating follow-up is a series events scheduled to occur at regular intervals. For example, a weekly status meeting. A recurring appointment is stored in two parts:

See also:

Example (SQL)

The system generates appointment records for all the recurrence instances:

SELECT appointment_id, associate_id, activeDate, type, status, recurrenceRuleId 
FROM appointment WHERE recurrenceRuleId = 1
appointment_idassociate_idactiveDatetypestatusrecurrenceRuleId
264152021-11-04 11:30:00111
267152021-11-09 11:30:00111
268152021-11-11 11:30:00111
269152021-11-16 11:30:00111
270152021-11-18 11:30:00111
271152021-11-23 11:30:00111

Let’s look at the rule:

SELECT * FROM recurrencerule WHERE recurrencerule_id = 1
RecurrenceRule_idpatternsubPatternstartDateendDatecyclicDaycyclicWeekcyclicMonth
1202021-11-04 11:30:002022-01-27 12:00:00010

This recurrence rule has:

  • pattern = 2 (weekly) (corresponds to the radio-button choice in the dialog).
  • subPattern = 0 (none)
  • cyclicWeek = 1  = “every 1 week(s)“

Reference

Frequently used database fields

FieldDescription
appointment_idID
associate_idowner
contact_idcompany
person_idattendee if a meeting
task_idxFK Task list
typeEnumAppointmentType
statusEnumAppointmentStatus
mother_idFor group reservations and invites
locationCustom string or info from a booked resource
alldayEvent0 = no; 1 = yes
freeBusy0 = busy; 1 = free

For a complete list of fields, see the database reference.

Appointment types

TypeDescription
0Undefined/initializing
1In calendar, if overdue or done today, also in todo list
2In todo list (no start time)
6Meeting invite (changes to 1 when accepted)
7Pending assignment (changes to 2 when accepted)

Appointment status

StatusDescription
0Unknown/ a post-it
1Not started
2Started
3Completed
4Hidden
5-10Booking
11-13Assignment

Timestamp values

FieldDescription
registeredUtcDateTime of registration
updatedUtcDateTime of last update
doneWhen a task was completed (DateTime)
do_byPlanned deadline for task (DateTime)
activeDateDisplay date (DateTime)
endDatePlanned completion time (DateTime)

Relevant invitation statuses

StatusDescription
5Invitation (initial status for a booking)
6Meeting has been moved, request new response
7User has seen, but not declined or accepted the invite
8Meeting has been moved. User has seen, but not responded to the invite
9User has declined the meeting
10Meeting is canceled

Frequency

ValueDescriptionCommentExample
dailyevery working day
every day of the week
or customevery other day
weeklyevery week on given daymust set weekdayevery 3 weeks on Tuesday
monthlyevery month on given daymust set day of monthon the 5th of the month, every 4th month
yearlyevery year on given datemust set day and monthevery 23rd of September

A cycle is the number of days between each recurrence.

The enum values correspond to what you see in the Pattern dialog.

Enum RecurrencePattern

ValueDescription
0unknown
1daily
2weekly
3monthly
4yearly
5custom

Enum RecurrenceSubPattern

ValueNameTypeDescription
0Unknown
1EveryWorkdaydailyMon-Fri
2EveryWeekdaydailyMon-Sun
3EveryCyclicDaydailycyclic interval of days
4DayOfMonthweeklyrepeat on day n of the month
ex: the 17th day of every 2 months
5WeekdayOfMonthweeklyrepeat on given weekday
ex: the 3rd Thursday of every 3 months
6DayOfMonthyearlyrepeat on given date every year
7WeekdayOfMonthyearlyrepeat on given weekdays of month
ex: the 3rd Thursday of every August
⚠️ Caution
The sub-pattern should match the pattern. There is little error-checking if you mix the wrong set. You can set pattern = yearly and sub-pattern = dailyEveryDay and something strange will probably happen.

Weekdays

ValueWeekday
0Unknown
1Monday
2Tuesday
4Wednesday
8Thursday
16Friday
32Saturday
64Sunday
🛈 Tip
Enumeration flag values can be combined.

Week of month

ValueDescription
0Unknown
1The 1st week of the month
2The 2nd week of the month
3The 3rd week of the month
4The 4th week of the month
5The last week of the month

How-tos by API