Introduction
The Create Microsoft calendar events feature allows you to automatically generate Microsoft Calendar (earlier Oulook Calendar) events from maintenance job schedules in asset management.
The integration uses Microsoft Graph to create events directly in workers’ Microsoft calendars. The integration works one way: maintenance schedules create or update calendar events, but changes made directly in the Microsoft Calendar are not synchronized back to asset management.
You must create an app registration in Microsoft Azure to allow finance and operations to create calendar events in Microsoft Calendar.
To create an app registration in Azure:
- Sign in to https://portal.azure.com using an administrator account in your Microsoft tenant.
- In the search bar at the top of the page, search for App registrations. You can also navigate to Microsoft Entra ID > App registrations.
- On the App registrations page, select + New registration.
- On the Register an application page (see screenshot 01), enter a Name.
- Select the supported account type, then select Register.
- On the application’s Overview page, note the following values (see screenshot 02):
- Application (client) ID
- Directory (tenant) ID
- In the left navigation pane, go to Manage > Certificates & secrets.
- On the Certificates & secrets page, select + New client secret (see screenshot 03).
- Enter a Description and select an Expiry duration, then select Add.
- Copy the secret value immediately from the Client secrets tab (see screenshot 04). Note that the secret value is shown only once and cannot be retrieved later.
- In the left navigation pane, select API permissions.
- On the API permissions page, select + Add a permission (see screenshot 05), then:
- Select Microsoft APIs tab, and select Microsoft Graph (see screenshot 06).
- Next select Application permissions, and search for and select Calendars.ReadWrite and select Add permissions (see screenshot 07).
- On the API permissions page, select Grant admin consent for <Your Tenant Name>, and confirm the action (see screenshot 08). Note the this button text dynamically includes your tenant name.
- Note
- Ensure that the permission status shows Granted for <Tenant Name> before continuing (see screenshot 09).
- If the status does not show Granted, the integration will not function.
01: The 'Register an application' page.
02: The 'Overview page' with 'Application (client) ID' and 'Directory (tenant) ID'.
03: The 'Certificates & secrets' page.
04: The secret value on 'Client secrets' tab.
05: 'API permissions page' with 'Add a permission' button.
06: 'Request API permissions' page to select an API.
07: 'Request API permissions' page with permissions for 'Microsoft Graph'.
08: 'API permissions page' with option to grant admin consent for tenant.
09: API permission with status of permission.
After creating the app registration in Azure, you must configure Microsoft Graph in F&O to establish the connection.
To configure Microsoft Graph in Email parameters:
- Go to System administration > Setup > Email > Email parameters.
- On the Email parameters page (see screenshot 01), open the Microsoft Graph settings tab.
- In the Tenant ID field, enter the Directory (tenant) ID from the Azure app registration.
- In the Application ID field, enter the Application (client) ID from the Azure app registration.
- In the Application secret field, enter the secret value created earlier, and select Save.
After configuring Microsoft Graph in Email parameters, you can optionally test the integration by creating a sample calendar event.
To test the Graph integration from Asset management parameters:
- Go to Asset management > Setup > Asset management parameters.
- On the Asset management parameters page (see screenshot 01), open the Graph integration tab.
- In the Email field, enter the email address of a user from the Microsoft tenant configured in Email parameters. The email address is used only for testing and is not stored in the setup.
- Select Create test event to generate a test calendar event in the specified user’s Microsoft Calendar.
- If the integration is configured correctly, the test event is created in the selected user's Microsoft Calendar.
Note:
- Ensure that the email address entered belongs to a valid user in the configured Microsoft tenant. If the email does not exist in the tenant, the test event cannot be created.
01: The 'Asset management parameters' page.
Before creating calendar events from maintenance job schedules, ensure that each worker has a valid email address in the configured Microsoft tenant.
To assign or verify an email address for a worker:
- In D365 F&O, go to Human resources > Workers > Employees.
- On the Employees page, select a worker who is also configured as an asset management worker.
- Open the Contact information FastTab (see screenshot 01), in the Primary email field, enter or verify the worker’s email address, and select Save.
- Note that calendar events can only be created for workers who have:
- A valid primary email address.
- An email address that exists in the Microsoft tenant configured in Email parameters. If the worker does not have a valid email address in the configured tenant, the system cannot create a calendar event for that worker.
01: The 'Employees' page with 'Contact information' FastTab.
After completing the setup, you can create Microsoft calendar events based on maintenance job schedules. This batch job processes maintenance job schedules, and creates or updates calendar events for assigned workers.
To create Microsoft calendar events:
- Go to Asset management > Periodic > Create Microsoft calendar events from work order maintenance job schedules (see screenshot 01).
- If the menu item is not visible (known issue in version 2510), navigate directly using: /mi=SysClassRunner&cls=DynGraphCreateCalendarEventsFromSchedules
- Open the Create Microsoft calendar events form and configure processing parameters.
- Click OK to run the batch job.
- The batch job processes maintenance job schedules and creates or updates calendar events for the workers assigned to those schedules. On running the batch job, in the Message details, you will see the status message (example as seen in screenshot 02).
Batch job parameters
- Lookback days: Defines how many days back from today the system processes schedules.
- Lookforward days: Defines how many days forward from today the system processes schedules.
- Example: If Lookback days = 0 and Lookforward days = 30, the job processes schedules from today at midnight up to 30 days forward.
- Number of retries: Defines how many times the system retries if Microsoft Graph is temporarily unavailable.
- Verbose logging: Displays additional informational messages during execution.
01: The 'Create Microsoft calendar events from work order maintenance job schedules' dialog.
02: A sample of the 'Message details' page with message about the batch job.
When you run the Create Microsoft calendar events job, the system evaluates maintenance batch job schedules within the defined date range, and creates or updates calendar events for the assigned workers.
The job runs as a batch process and performs the following actions:
- Creates calendar events for maintenance job schedules that have not been processed before.
- Updates existing calendar events if the schedule, line, or work order has changed.
- Recreates a deleted calendar event only when a related schedule change occurs.
- The calendar event includes (see screenshot 01):
- Work order information
- Scheduled start and end time
- Maintenance worker remark, if entered
- Internal note, if entered
- Mobile link, if the worker is an active Dynaway mobile user
- If a calendar event is modified or deleted directly in Microsoft Calendar, the changes are overridden the next time the batch job runs.
- Note: The integration works one way only. Changes made in Microsoft Calendar are not synchronized back to maintenance job schedules in D365 F&O.
01: A sample of the scheduled calendar event.