Showing posts with label D365Sales. Show all posts
Showing posts with label D365Sales. Show all posts

Sunday, February 9, 2025

Understanding Dual Write in Dynamics 365: A seamless data integration approach

dual write image
New to dual write? Here's where you should start from. This isn't a deep-dive into this new capability from Microsoft, but the first step for you to understand the key differences between noth Dynamics 365 CE and F&O and why was this required.

What is Dual Write?

Dual Write is an out-of-the-box infrastructure that ensures data consistency between customer engagement apps (CE) and finance and operations (F&O) apps.

Customer engagement apps, such as Dynamics 365 Sales and Customer Service, focus on managing customer relationships, sales, and marketing interactions. These are process driven and can tailor to your customer's needs and business processes.

On the other hand, finance and operations apps, like Dynamics 365 Finance and Supply Chain Management, handle back-office functions such as financial transactions, inventory, and supply chain operations. These are more rigid applications because they fulfil a certain purpose and cannot be customized to the extent that a front-office app can be.

Historically, these two areas operated in silos, leading to data duplication and inefficiencies. Dual Write was introduced to bridge this gap, ensuring real-time data flow between the front office and back office, enabling businesses to operate with a unified and accurate data set across departments.

Key Benefits of Dual Write

  • Seamless Data Synchronization – Ensures that customer, product, and financial data remain consistent across systems.
  • Enhanced Business Processes – Provides a unified experience across sales, customer service, supply chain, and financial management.
  • Real-Time Updates – Improves decision-making by reducing latency in data updates.
  • Reduced Customization Efforts – Eliminates the need for complex custom integrations.
  • Improved Customer Experience – Ensures that all teams have access to up-to-date customer information, leading to better service.

Use Cases of Dual Write

  • Customer Data Management: Keep customer records synchronized between CRM (D365 CE) and ERP (D365 F&O), ensuring all departments have access to accurate information.
  • Product and Pricing Updates: Synchronize product catalogs and pricing details across sales, e-commerce, and finance platforms.
  • Order Processing & Invoicing: Automatically sync order details and financial transactions across systems to streamline the order-to-cash cycle.
  • Inventory & Supply Chain Management: Ensure accurate stock levels, purchase orders, and logistics data across finance and operations teams.

Technical Considerations

  • Customization and Extensibility: Dual Write supports custom tables and extensions, allowing businesses to tailor integrations to their needs.
  • Data Security & Compliance: Ensure that data policies and governance are in place to comply with industry regulations.
  • Performance Monitoring: Regular monitoring and performance tuning can help prevent sync failures and maintain optimal system performance.
  • Error Handling & Troubleshooting: Implement robust error logging and resolution mechanisms to address data conflicts or sync issues.
In conclusion, I see this as a game-changer for businesses using Dynamics 365. By using this organizations can achieve real-time data consistency and reduce costs. As companies adopt digital transformation strategies, dual write becomes a key enabler for a unified and connected enterprise.

Wednesday, June 19, 2024

All about Addresses in Dynamics 365

We had a requirement regarding addresses that had to be addressed in Dynamics 365 CE. I thought to share it.

Requirements

  • To be able to select the following fields as a dropdown, preferably a lookup. Fields: District, City and Country because the District and City list may continue to expand in the future.
  • To be able to add multiple addresses against the Account. 2 or more.
  • In case we need to update an address, there must be a provision in the Address table to select the District, City and Country as well. i.e., these fields must be available in the Address table as lookup fields.
These requirements sound simple to implement, however the address entity lacks flexibility due to which we had to think of a workaround.

Things I have learnt about Addresses

  1. On the Account we can add maximum 2 addresses. Address 1 and Address 2. Let's call this embedded address. If we need to add a 3rd address related to an account, we need to create a new address record (in the related system Address table).
  2. While the Country and State fields are available, these are text fields in the embedded address and related system address table.
  3. The related address table is non-customizable. We cannot add additional lookup fields in that entity.
  4. When an Account or Contact record is created, blank Address records are automatically created and linked to the Account (or Contact). These are associated with the embedded address records and are numbered as "addressnumber" 1 and 2. addressnumber 1 represents invoice address and 2 represents delivery address by default.
  5. The system Address tables don't have lookup to Account or Contact. The relationship is identified by 2 fields namely, "objecttypecode" and "parentid". objecttypecode recoginzes if this related address is linked to "Account" or "Contact" and parentid is the actual GUID value of the Account or Contact.

Workaround to address the limitations

Since the system Address entity is linked and tightly integrated in Dynamics 365 CE, we couldn't replace the system Address table with new custom Address table. I am saying this because, system Address primarily linked to Account and Contact, but when we update the address on Lead and qualify it, the embedded Address and correspondingly the system Address records are also updated. Also, indirectly linked with Opportunities, Quotes and beyond. If you're considering dual write integration with Dynamics 365 F&O, these are again tightly integrated there.

Having analyzed this, we went ahead with a custom Address entity but ensured we are keeping the system Address entity records in sync as well.

What did we do?
  1. We created 3 custom lookup fields called District, City and Country on the Lead, Account and Contact tables for easy data entry from users perspective. When the user selects these fields, we populate the OOB District, State and Country text fields and those are automatically updated in the related system address records.
  2. We introduced a custom address entity and ensured the user uses this for their data entry and viewing. When the user updates the embedded address, we also need to create custom address records related to Account.
  3. When the custom address records are updated, we need to update the related system address entity records.
  4. When a new custom address is created, we create a related system address entity record and link it with the respect Account by updating the objecttypecode and parentid.
  5. When the custom address is deleted, we need to also delete the related system address record and update the embedded addresses if the addressnumber matches. By update I mean we had to clear the values in the embedded address fields on the Account record.
  6. For the most part we can treat system Addresses as a target only, as they are a copy of the custom Address entity data. We can set up a business process and data entry process in such a way that system addresses are not updated, however, if some process we don’t know about updates a system Address, it needs to get reflected up to the custom Address as well.
Hope that helps!

Wednesday, December 13, 2023

Dual-Write | Update the Delivery Address in Sales Order from D365 Sales to F&O

We have Dual-Write enabled in one of our customer sites and we are syncing sales orders from D365 Sales to D365 F&O. The issue that we were facing is, when we update the delivery address in D365 Sales, i.e., on Order form (in CE), we have a field called "Choose Ship to Address", while the address is updated on the Order form (in CE), it doesn't update the delivery address in D365 F&O Sales Order form.

Note: for the Address integration to work via dual-write, you need to enable GAB (Global Address Book) app.

After some R&D, we cracked it.

We wrote a workflow to update the Delivery Address Location ID based on the address selected in the field "Choose Ship to Address".

Note: Delivery Address Location ID is also a field on the Order form in D365 Sales. By default you can see that under the Integration tab.

D365 CE Sales Order form

Below is the screenshot of the workflow that was created. Workflow to be created on the Order table and the trigger is when Choose Ship to Address is updated.

Steps:
Condition: if Choose Ship to Address contains data
Update: Delivery Address Location ID (Order) = Location ID (Address)


I am not mentioning the Dual-Write table maps here, but we were using OOB tables maps on the Order table. In case you have updated with custom table maps, you may want to check it (in case the address is still not updating).

Hope this helps!

Tuesday, October 17, 2023

Troubleshoot Dual-Write Issues in Dataverse and F&O Apps

I have written couple of articles on Dual-Write lately. Mostly on issues that we've been facing lately and how we have come to fix them. These post is where I bring them all together. You can think of this blog post as a summary of all the issues and fixes until now and will continue to update the same in the future.

Also certain topics don't need a separate post. Will write about them here directly. Starting below with the posts that I have written previously.

Previous Posts


Unable to create a Quote in Dynamics 365 Sales App

This was because we were receiving an error

"Write failed for entity CDS sales quotation header with unknown exception - BOX API can't be used from non-interactive sessions."

 Click here to read the post.


Privileges required for dual-write initial sync

There are certain security roles and privileges required to perform initial sync of tables via dual-write.

Click here to read the post.


Unable to delete postal addresses in Dynamics 365 Sales

This happened because there were related records, and I wasn't able to delete them too.

Click here to read the post.


Unable to create an order from a quote in Dynamics 365 Sales App

Here is the precise error that I was receiving.

"Write failed for entity CDS sales order lines V2 with unknown exception - Inventory dimension Site is mandatory and must consequently be specified.\nUpdate has been canceled."

Click here to read the post.


Other Issues


Unable to load the dual-write module in a Finance and Operations App

If you're unable to open Dual-write page by selecting the Dual Write tile in the Data management workspace, most likely data integration service is probably down.

For this you would need to create a MS support ticket and request a restart of the data integration service.

Wednesday, September 27, 2023

Unable to update Order Product using Workflows in D365 CE

Here is a note for y'all, something to keep in mind when working with workflows in Dynamics 365 Customer Engagement (D365 CE).

You can create a workflow (i.e., initiate a workflow) on the following tables:
  • Opportunity Product
  • Quote Product
  • Order Product
But when you add a step to Update record within the workflow, you'll notice that you cannot update the above mentioned tables (entities). You can however update any of the related tables linked with these tables.

Add Price List Items too into the above mix. Can create a workflow based on this table, but cannot update Price List Item record using a workflow step.

I believe the workaround would be to use Power Automate flows instead of Workflows. I haven't tried this as yet, but I believe it is possible.

Hope it helps!

Thursday, August 17, 2023

Dual-Write | Unable to create Order from Quote in D365 CE Sales

While converting a Quote into an Order in D365 CE Sales, I was receiving an error message that went like:

Dual Write core application error-Dual Write core application error-Unable to write to Finance and Operations apps due to following error(s): {"Write failed for entity CDS sales order lines V2 with unknown exception - Inventory dimension Site is mandatory and must consequently be specified.\nUpdate has been canceled."} Please rectify your data and try again. If issue persists after multiple retries, please contact your system administrator.

Since dual write is seamless integration and data synchronization across D365CE and D365FO and as the default shipping site and warehouse is required while creating the Order in F&O, we need to ensure that the value is populated prior to creating the Sakes Order. 

Solution

While encountering an error can be frustrating, the good news is that there is a solution.

In this case, the remedy involves performing relationship mapping between the Quote and Order entities. Relationship mapping essentially defines how data is transferred between related entities.

Steps:

  • Open the solution in D365 Sales App. Ensure you've added the following components:
    • Quote and Order tables
    • 1:N relationship between Quote and Order
  • Open the relationship and click on Relationship Mapping
  • Add a new Map and select Default Shipping Site and Default Shipping Warehouse.
  • Now try to convert the Quote into an Order.
It should be smooth sailing now.

Hope that helps!

Friday, August 11, 2023

Error when qualifying Lead into Opportunity | D365 Sales

There could be many reasons and most of it could be found when you perform an online search, but none of those suggestions fixed my issue. When I was qualifying the Lead into an Opportunity, it is showing the following error:

OrganizationServiceFault

And that is it. No other details about the error. No error log, not description of the error, no error code. Nothing!

Resolution

My user didn't have system administrator, but a custom role was assigned to the user. I took some help from my technical team who did a little bit of digging and came across this below message.

Entered Microsoft.Dynamics.SCMExtended.Plugins.Plugins.LeadPrimaryContactPostCreate.Execute(), Correlation Id: 021c0dc2-3e1e-46e5-81c0-b1524ae09ed2, Initiating User: e7925424-1da4-ed11-aad1-002248a13b63

Exception: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Principal user (Id=xxxx5424-xxxx-ed11-xxxx-002248a1xxxx, type=8, roleCount=4, privilegeCount=1064, accessMode=0, MetadataCachePrivilegesCount=9751, businessUnitId=0b2c4b59-0e31-ee11-bdf4-000d3aba3d29), is missing prvReadSolution privilege (Id=b64e92c8-5d2a-4052-a026-1b73eff9cebf) on OTC=7100 for entity 'solution' (LocalizedName='Solution').

I provided a Read privilege to Solution table under; relevant Security Role > Customization > Solution, and it worked.

Hope it helps!

Friday, August 4, 2023

Dual-Write | Unable to delete Postal Address Collections in D365 Sales

If you're unable to delete Postal Address Collection records in Dynamics 365 Customer Engagement Sales App, most likely the reason is there is related Postal Address records under that.

When I try to delete Postal Address records using Advanced find, I couldn't find the Delete button on it. If I open the record (for Postal Address), still couldn't see the delete button.

I used Bulk Record Deletion job to delete Postal Addresses and then I could go ahead and delete Postal Address Collections.

What are these tables you ask? These are added when you implement dual-write and install GAB solution in the dataverse. If the 2 environments are in sync, it is best to delete these records in F&O and let dual-write handle the deletion in D365 CE Sales.

We were in a situation where the F&O environment wasn't in sync with CE and we had to remove these records manually in CE only.

Hope it helps!

Dual-Write | Privileges required for Initial Sync and other considerations

Recently we were doing an initial sync for tables between Dynamics 365 Finance & Operations apps and Dataverse (Dynamics 365 Customer Engagement), and we received an error that read:

Reason: Bad Request, Header x-ms-client-request-id 8aef8aa3-2a01-493e-a0d7-347ce560e50d, Principal team (Id=b7e1929e-xxxx-xxxx-aad0-xxxx489fxxxx, type=9, teamType=0, privilegeCount=0, MetadataCachePrivilegesCount=9751, businessUnitId=b5e1929e-xxxx-xxxx-aad0-xxxx489fxxxx), is missing prvReadmsdyn_globalproduct privilege (Id=539cf392-xxxx-xxxx-b258-xxxx719b7d93) on OTC=10835 for entity 'msdyn_globalproduct' (LocalizedName='Global Product') in Business Unit: unqxxxx (Id=b5e1929e-xxxx-xxxx-aad0-xxxx489fxxxx). context.Caller=691e1af2-xxxx-xxxx-aad1-xxxx489axxxx

Sometimes when you're excited and hurrying into the action, you miss the fine details and here are the fine details.

Security role that is required

Every user in a customer engagement organization with dual-write must be given Dual-Write Runtime User role. Without this role, users will be unable to create any rows in tables in customer engagement organization.

Company and currency exchange tables are global in nature and all dual-write users require read access to these 2 tables. To provide access, all dual-write users must be given Dual-Write App User security role. If a user does not have this security role assigned to them, they will not be able to read tables that contain Company and Currency.

Also access is required to entities (tables in dataverse) that are in scope of dual-write. However which privilege is required is not very clear. What you can do is to create a custom role and provide the relevant privilege to the tables in scope of your dual-write integration. We had provided Create, Read and Write which worked for us.

PS: I do believe Read privilege should be enough. Comment down below if you have an experience regarding the exact privilege required.

Here is the link to other considerations before performing initial sync & setup dual-write security roles and permissions.

Hope this helps!