4D Blog

Home Product Managing Calendar Events with Microsoft 365 or Google in 4D: Create, Update, Delete

Managing Calendar Events with Microsoft 365 or Google in 4D: Create, Update, Delete

July 17, 2025

Product

Working with calendar events is a core part of many business applications. Whether you’re organizing a team meeting or managing an event’s life cycle, being able to create, update, and delete events programmatically is essential.

In this blog post, we’ll walk through how to perform these operations using the Office365.calendar or Google.calendar classes provided in 4D 20 R10, powered by the Microsoft Graph and Google Calendar APIs.

HDI Calendar Events Management

Let’s explore how simple it is to create, update, and delete a meeting in Microsoft or Google Calendar using 4D NetKit, with the example below.

Account connection

As usual, before using Google or Microsoft APIs, we will create an OAuth 2.0 connection object:

For Google API:

var $oAuth2:=cs.NetKit.OAuth2Provider.new($googleCredentials)
var $google:=cs.NetKit.Google.new($oAuth2)

For Microsoft API:

var $oAuth2:=cs.NetKit.OAuth2Provider.new($microsoftCredentials)
var $office365:=cs.NetKit.Office365.new($oAuth2)

Create an Event

The calendar.createEvent() function allows you to create a new event in a calendar, either in the default calendar of the current user or a specified calendar.

for Google API:

var $myEvent:={start: {}; end: {}}
// Create a one-hour meeting
$myEvent.start.date:=Current date
$myEvent.start.time:=Current time
$myEvent.end.date:=Current date
$myEvent.end.time:=Current time+3600

$myEvent.summary:="My event"
$myEvent.description:="This is an invitation"
$myEvent.attendees:=[{email: "myAttendeeAddress@mail.com"}]
// Meeting creation
$event:=$google.calendar.createEvent($myEvent)

for MICROSOFT API:

var $myEvent:={start: {}; end: {}}
// Create a one-hour meeting
$myEvent.start.date:=Current date
$myEvent.start.time:=Current time
$myEvent.end.date:=Current date
$myEvent.end.time:=Current time+3600
$myEvent.isAllDay:=False

$myEvent.attendees:=[{emailAddress: {address: "myAttendeeAddress@mail.com"}; type: "required"}]
$myEvent.subject:="My event"
$myEvent.body:={content: "This is an invitation body"; contentType: "text"}
// Meeting creation
$event:=$office365.calendar.createEvent($myEvent)

Update an Event

The calendar.updateEvent() function lets you modify an existing event. You only need to provide the properties you want to update — existing ones not included remain unchanged.

for Google API:

var $myUpdateEvent:={}
$myUpdateEvent.summary:="My updated subject"
// Meeting update
$event:=$google.calendar.updateEvent($myUpdateEvent)

for MICROSOFT API:

var $myUpdateEvent:={}
$myUpdateEvent.subject:="My updated subject"

// Meeting update
$event:=$office365.calendar.updateEvent($myUpdateEvent)

Delete an Event

The calendar.deleteEvent() function removes an event from a calendar. If the event is a meeting, attendees are notified automatically with a cancellation message. Both commands take the same parameters:

for Google API:

$status:=$google.calendar.deleteEvent({eventId: $event.event.id})

for MICROSOFT API:

$status:=$office365.calendar.deleteEvent({eventId: $event.event.id})

Conclusion

By combining the createEvent, updateEvent, and deleteEvent functions from 4D NetKit, you can fully manage Microsoft 365 or Google calendar events directly from your 4D applications. Whether you’re building a meeting scheduler, a booking system, or a custom dashboard, this integration gives your users powerful tools to stay organized and connected.

Discuss

Tags 20 R10, 21, 4D NetKit, Calendar, Google, Microsoft 365

Latest related posts

  • February 3, 2026

    4D Write Pro – Adding a margin automatically when bullets are set using standard actions

  • January 22, 2026

    Transform Static Documents into Actionable Knowledge with AIKit

  • January 22, 2026

    Deploy Fluent UI effortlessly in your 4D applications

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • Release infos
  • 4D View Pro
  • 4D Write Pro
  • Email, Microsoft 365, Gmail
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • 4D Qodly Pro
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy