Follow

API code example: Add all day activity

Adding activities to Visma Severa through API is done by using IActivity interface. When there is a need to add all day activities, these things are good to keep in mind:

  • The start time and end time for the activity are given in UTC.
  • The activity must start and end at midnight.
  • The activity needs to have "IsAllDay" flag set to true.
  • The activity needs to have "IsDuration" flag set to true.
  • If end time is not given, the activity will last one day, and Visma Severa will calculate the end time for the activity.

Here is a code example that adds a new all day activity to Visma Severa, for 16.12.-20.12.2013:

Dim activity = New SeveraAPI.Activity
activity.AccountGUID = Nothing
activity.ActivityTypeGUID = 
activity.StartDateTime = New Date(2013, 12, 15, 22, 0, 0)
activity.EndDateTime = New Date(2013, 12, 20, 22, 0, 0)
activity.IsAllDay = True
activity.IsClosed = False
activity.IsDuration = True
activity.IsPrivate = False
activity.IsReadOnly = False
activity.Location = ""
activity.Name = "Away"
activity.Notes = "Away"
activity.OwnerUserGUID = 
activity.TaskGUID = Nothing

Dim success = activityClient.AddNewActivity(activity)

The activity in calendar:

all_day_activity_from_api_in_calendar.png

Activity in reporting:

all_day_activity_from_api_in_reporting.png

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Powered by Zendesk