In this blog, we’ll explore how to set up an asynchronous integration between D365 Finance and Operations (F&O) and D365 Customer Engagement (CE). This integration will ensure that whenever a customer is created, updated, or deleted in D365 F&O, the corresponding data is reflected in D365 CE. The process involves fetching a new access token for each interaction with CE via its API.
Prerequisites:
Before we start, ensure the following:
-
D365 CE app must be registered in Azure Active Directory.
-
Obtain the necessary details such as Client App ID, App Secret, Tenant ID, and CE URL for authentication.
Step-by-Step Guide to Customer Integration
We will define a class CustomerIntegrationHandler
in X++ to manage the interaction with D365 CE. Below are methods to create, update, and delete customer records from D365 F&O and push them to D365 CE.
Authentication:
The following method will be used to obtain the OAuth token required for accessing D365 CE’s API.
Create Customer in D365 CE:
The following method will create a new customer record in D365 CE using a POST request.
Update Customer in D365 CE:
To update an existing customer in D365 CE, we will use a PATCH request as shown below:
Delete Customer from D365 CE:
The following method will delete a customer record from D365 CE using a PATCH request to deactivate the customer.
Conclusion:
With these methods, you can now integrate D365 F&O with D365 CE to create, update, and delete customer records asynchronously. This process enables seamless data synchronization between the two systems and enhances your enterprise application architecture.
0 Comments