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!