Dynamics 365 Field Service

Dynamics 365 Field Service Integration with Solvice Route Optimization API

Intro

Microsoft Dynamics 365 Field Service serves as a robust solution to enhance the efficiency of field service operations. This platform empowers field service teams through real-time visibility into service activities, resource scheduling, and inventory management. Dynamics 365 Field Service equips businesses with tools for predictive maintenance, proactive issue resolution, and intelligent insights, thereby fostering productivity and ensuring a seamless end-to-end service delivery process. Whether managing work orders, dispatching technicians, or analyzing performance metrics, this dynamic solution enables organizations to adapt and excel in the ever-evolving landscape of field service management.

Solvice's VRP API complements these capabilities, providing businesses with precise and efficient route planning to save time, reduce costs, and elevate customer satisfaction. Real-time tracking and analytics features allow businesses to monitor their fleet, gaining valuable insights for continuous operational improvement.

By integrating the capabilities of Dynamics 365 Field Service and Solvice's Route Optimization API, businesses can revolutionize their field operations, maintaining a competitive edge in today's market.

Pre Requisites

In order to successfully integrate Dynamics 365 Field Service with Solvice's services, certain prerequisites must be met. These include:

Active Microsoft Dynamics 365 Field Service account: Ensure that you have a functional and active account for Microsoft Dynamics 365 Field Service. This account serves as the foundational element for the integration, providing access to the necessary functionalities within the Dynamics 365 Field Service platform.

Valid API key from Solvice: Acquire a valid API key from Solvice, which acts as the authentication mechanism for connecting your Dynamics 365 Field Service instance with Solvice's services. This key establishes a secure and authorized communication channel between the two platforms, facilitating seamless data exchange and integration. Contact support to get your API key.

By satisfying these prerequisites, you create the essential groundwork for a successful and secure integration between Dynamics 365 Field Service and Solvice's Route Optimization API.

Integration steps

Step 1: Set Up Dynamic 365 Field Service Application

Assuming the availability of the Dynamics 365 Field Service application with the user, follow these steps to establish an external connection through OAuth:

  1. Configure Connection in Microsoft Azure Cloud Platform

Log in to Microsoft Azure Cloud.
Navigate to 'App registrations' and select 'New Registration.'

Microsoft Dynamics 365 Field Service App Registration

  1. Fill Application Details

Enter the required details for the application, including a suitable Name and Redirect URI (e.g., localhost or a chosen web platform).

Microsoft Dynamics 365 Field Service App Registration

Microsoft Dynamics 365 Field Service App

  1. Application Registration

Upon registration, your application is created.
4. Create Client Secret

Generate a client secret for authentication by clicking 'Add.'
Immediately copy and securely store the client secret, as it cannot be retrieved later.

  1. Authentication

Use the client ID and secret credentials to test the application and generate an access token.
Utilize tools like Postman for generating and testing the access token.

  1. Validate Basic CRUD Operations

Verify basic CRUD operations using the generated access token.
By following these steps, you establish an OAuth connection for Dynamics 365 Field Service, facilitating secure external access and enabling essential operations through the generated access token.

Step 2: Pull Resources from Dynamics 365 Field Service

In this step, we retrieve work order tasks from the Dynamic 365 Field Service account. The objective is to pull a comprehensive list of vehicles that provide essential details for further analysis and optimization.

# Fetch Vehicles from Dynamic 365 Field Service
curl --location 'https://org83f3f8a8.crm.dynamics.com/api/data/v9.0/bookableresources?$select=*&$filter=statuscode%20eq%201' \
--header 'Accept-Language: en-US' \
--header 'Authorization: Bearer <access_token>' 
{
  "@odata.context": "https://org83f3f8a8.crm.dynamics.com/api/data/v9.0/$metadata#bookableresources(*)",
  "value": "[...]"
}

Here's an explanation of the key components:

  • @odata.context: This specifies the OData metadata context, indicating the data model and version. In this case, it points to the metadata for bookable resources in Dynamics 365 Field Service.
  • value: This is an array containing the details of individual resources. Each element within this array represents a separate resource (e.g., a vehicle or field service personnel).
  • @odata.etag: A unique identifier for the resource's current state. It helps in managing concurrency and ensuring data consistency.
  • statecode: Represents the state of the resource. A value of 0 typically indicates an active state.
  • statuscode: Indicates the status of the resource. A value of 1 commonly signifies an active status.
  • msdyn_displayonscheduleboard: Boolean indicating whether the resource should be displayed on the schedule board.
  • createdon: The timestamp indicating when the resource was created.
  • _msdyn_organizationalunit_value, _calendarid_value, _owningbusinessunit_value, _ownerid_value: These are unique identifiers referencing other entities within Dynamics 365 Field Service, such as organizational units, calendars, business units, and owners.
  • name: The name or identifier of the resource (e.g., "Mickey Mouse").
  • versionnumber: A numerical value representing the version of the resource.
  • timezone: An integer representing the timezone associated with the resource.
  • msdyn_enableoutlookschedules, msdyn_enabledripscheduling, msdyn_enabledforfieldservicemobile: Boolean values indicating specific functionalities enabled for the resource.
  • modifiedon: The timestamp indicating when the resource was last modified.
  • msdyn_endlocation, msdyn_startlocation: Numeric identifiers representing the end and start locations of the resource.
    Other fields represent additional details about the resource, such as hourly rates, geographic coordinates, and organizational information.
    This response provides a comprehensive set of data about each vehicle, allowing for detailed insights into their characteristics and configurations within the Dynamics 365 Field Service application.
    The work order records will be mapped to the jobs or shipments parameter in Solvice's Route Optimization API. The work order records are pulled from the Dynamic 365 Field Service application using the GET request.

Step 3: Pull Work Order (jobs) from Dynamics 365 Field Service

Step 4: Map to Solvice VRP API

  • After successfully pulling data from Dynamics 365 Field Service, integrate the fetched data with Route Optimization API.

  • Use the provided API endpoint to map the data to respective API parameters.

  • Configure optimization settings, including shift start and end times, service time, and start and end location coordinates.

Step 5: Create Solve Request

curl https://api.solvice.io/v2/vrp/demo -H "Authorization: <<apiKey>>" |  \
    curl https://api.solvice.io/v2/vrp/solve -H "Authorization: <<apiKey>>" \
    -X POST -H "Content-Type: application/json" -d @-
{
  "id": "9b4dc520-fd66-40cb-846f-908ccaee8e5d",
  "status": "QUEUED"
}

Step 6: Retrieve Solve Result

curl https://api.solvice.io/v2/vrp/job/<<jobId>> -H "Authorization: <<apiKey>>"

Visualize the Route

Explore and analyse optimized routes effortlessly using Solvice's Route Planner Tool.
This tool is accessible through Solvice Dashboard, providing a user-friendly interface for visualising, reviewing, and fine-tuning routes generated by the optimization process.
Seamlessly navigate through the routes, gaining valuable insights into the geographical distribution and efficiency of planned tasks. Leverage the Route Planner Tool to enhance route visualisation and optimize your field service operations with ease.

The following image showcases the optimized routes within the Route Planner Tool interface.

Microsoft Dynamics 365 Field Service Display job in Solvice