• Dualwrite – Beware of the reverse

    I am setting up Dualwrite at a customer and I got an issue the other day. The customer wants to be able to create customers from Dynamics 365 CE and syncing them to Dynamics 365 for FO. We had done all of the initial syncs and done multiple test for creating Accounts in CE and the synced perfectly to FO.

    When I was trying to figure out a way to manage Financial Dimension population while creating accounts I tried creating the customer directly in FO, just to test a thing… and it failed!!

    I tried again from CE and it worked… but not from FO. We had been so focused on testing one direction but not the other… Doh!

    So, what was the issue? I got this error:

    Unable to write data to entity accounts.Writes to CustCustomerV3Entity failed with error message Request failed with status code BadRequest and CDS error code : 0x80048d19 response message: Error identified in Payload provided by the user for Entity :'accounts', For more information on this error please follow this help link https://go.microsoft.com/fwlink/?linkid=2195293 ----> InnerException : Microsoft.OData.ODataException: Cannot convert the literal '' to the expected type 'Edm.Int32'. ---> System.FormatException: Input string was not in a correct format.
    

    and then it continued with a stack trace… Hmmm…

    So I started brainstorming with a colleague: It is obviously a data type missmatch and when I turn off the mapping for Account, it works. Going through the mapping we had added a few transform mappings so we started there. It turns out that all of these we 1 to 1 mappings. The problems was that there three fields were not on the initial “customer creation sidebar”. In CE these were made mandatory but in FO, they were not.

    I took a look at the mappings for these 3 fields and one stood out. It had no mapping for the empty value.

    This meant that when going from FO to CE I tried to convert and empty string to an integer and since there was no transform for the empty field and no default it could not be written to CE.

    The easiest way to add an empty mapping to null is to edit the JSON version of the mapping (I did not know this was possible until a short while ago)

    [
    	{
    		"transformType": "ValueMap",
    		"valueMap": {
    			"Dealer": "787980000",
    			"End user": "787980001",
    			"Nat OEM": "787980002",
    			"Reg OEM": "787980003",
    			"Int OEM": "787980004",
    			"Integrator": "787980005",
    			"Contractor": "787980006",
    			"Other": "787980007",
    			"": null
    		}
    	}
    ]
    
    
    
    
    
    

    Add the last line and do not forget the comma at the end of the previous line

    That was it… I saved it and restarted the mapping. We verified it… Worked!!!

    That was it for today… see you around

  • AADSTS50011: The redirect URI ‘https://D365FOenv.operations.eu.dynamics.com/’ specified in the request does not match the redirect URIs

    Last week I needed to set up a new Dynamics 365 for Finance and Supply Chain environment and I for a strange error message which took some time to figure out.

    AADSTS50011: The redirect URI 'https://enadvdemo01.operations.eu.dynamics.com/' specified in the request does not match the redirect URIs configured for the application '00000015-0000-0000-c000-000000000000'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

    (since I am not an EntraID expert I might be some details wrong in the explanation but this is what I think the issue is)

    The issue here is that when you are working with D365FO, which is a Microsoft Saas-ish service, there is a Service Principal created for Microsofts application in your Entra ID tenant. When you set up a new environment, the URL for that environment is added to that Service Principal as two ReplyUrls. One for the base URL and one for the OAuth endpoint.

    Apparently there is a limit (255) for how many of these URLs you can have for the Service Principal. This means that when you have deployed enough environments the property fills up. I am guessing that there might be a clean-up routine for these but that it might sometimes fail.

    The solution is to remove a couple of old ones and manually add the new ones.

    1. Log into the Azure Portal

    2. Start the Cloud Shell

    3. In the Cloud Shell, run the following commands

    connect-azuread
    
    $AADRealm = "00000015-0000-0000-c000-000000000000"
    Get-AzureADServicePrincipal -Filter "AppId eq '$AADRealm'"

    Find old, retired URLs here and run the following

    $EnvironmentUrl = "https://newenv.operations.eu.dynamics.com"
    
    $OLDEnvironmentUrl = "https://retired env.operations.eu.dynamics.com"
    
    $SP = Get-AzureADServicePrincipal -Filter "AppId eq '$AADRealm'"
    
    $SP.ReplyUrls.Remove("$OLDEnvironmentUrl")
    $SP.ReplyUrls.Remove("$OLDEnvironmentUrl/oauth")
    
    $SP.ReplyUrls.Add("$EnvironmentUrl")
    $SP.ReplyUrls.Add("$EnvironmentUrl/oauth")
    
    Set-AzureADServicePrincipal -ObjectId $SP.ObjectId -ReplyUrls $SP.ReplyUrls

    This will remove the retired URLs and add the ones for the new environment

    Links:
    Error AADSTS50011 – The reply URL specified in the request does not match the reply URLs configured for the application <GUID>. | Microsoft Learn
    Solved: AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: ‘00000015-0000-0000-c000-000000000000’.

  • Presentations from D365UG Sweden – Fall 2024

    Last week, on the 23rd of October I had the pleasure to speak in three sessions at the Dynamics 365 User Group Sweden in Stockholm at the Micrsoft Office.

    I had a great day, even if it started of with a presentation mishap which I managed to correct in time together with one of my fantastic colleagues. The lasting result was only an overdose of adrenalin 🙂


    Here are the links to the presentations: D365UG Fall 2024

  • Unable to find my ER Data Package

    A wee k or so ago, one of my colleagues contacted me from one of our customers. She was setting up VAT reporting for Germany and in the instructions it says that in order to set it up you will need to import a data package from the LCS Shared Asset Library. When she goes to the Shared Asset Library in LCS it is completely empty.


    It turns out that this customer is in the EU LCS tenant and Microsoft has not populated the Shared Asset Library in EU. To get to the files there is a fairlysimple solution:

    1. Before you log into LCS, make sure you are in the United States region


    2. Log in to LCS. Note: You will not see your project in the list of projects. It will be empty. Don’t worry, it is by design.
    3. Go to the Shared Asset Library – Data Packages. Find the package you are looking for, click it to download it.
    4. Log out from LCS, switch region and log in again.
    5. If you want it in you projects Asset Library, go to the Asset Library an Upload the package.

      That is all for today, good luck 🙂
  • Cannot access form Sales charge codes

    I had an issue today at a customer… We were not able to open the Charge code form in one of our environments.

    When we tried to open the form we also got a couple more error messages. tThe first saying that we could not read Retail Headquarter Parameters which lead us to try that form and we got an error which looks like: Parameter record does not exist.

    Turns out that this was a bug introduced in 10.0.37 and which will be fixed in 10.0.38 related to the feature called Enable proper tax calculation for returns with partial quantity. When this feature is enabled the system is not able to create a line in the parameter table for Retail Headquarters due to a default value is not allowed.

    The workaround is to disable the feature temporarily, initiate the creation of Retail parameters in the affected companies and then re-enable the feature.

    Good luck

    Links
    Details for issue 849710 (dynamics.com)

  • Help!! I closed the Excel Addin

    A colleague of mine pinged me today and wondered if there is a way to reopen the Dynamics Excel Addin if you accidentally closed it, other than going back to Dynamics and reopen the file.

    Since she was nice enough to ask the question and i did not know the answer I thought I might as well write it down so I do not forget 🙂

    1. In Excel, go to the insert tab. Then click My Addins

    2. Click on Microsoft Dynamics (if it is not there, click See all… instead and you will find it in the list)

    3. The Addin will open up again and reload the condent of the excel file from Dynamics 365 FO

    Good Luck

  • Issues syncing Sales Order Lines with Dual Write

    I am doing some experimenting with Synapse Links for Dataverse and to do that I need my FnO data in Dataverse. The way I do it, is using Dualwrite. When I try to sync Sales Order Lines V2 to salesorderdetails I get the following error:

    Reason: Bad Request, Header x-ms-client-request-id f1004256-8a98-42fe-86a9-02b8e64a81a9, Produkten kan inte läggas till eftersom den inte är aktiv

    (for those of you, not fluent in Swedish it says “The product cannot be added because it is not active)

    This means that the product is synced but it is not active. To activate the product it needs to be published. To do this go through the following steps:

    1. In Sales open products
    2. Select a product and click Publish

    The problem was I had a couple of thousand products. So I googled and found this forum thread helping me to write a workflow to automate it (this is way beyond my knowledge in CRM).

    Links:
    https://learn.microsoft.com/en-us/dynamics365/sales/publish-product-bundle-make-available-selling
    Bulk publishing products – Dynamics 365 Sales Forum Community Forum

  • Not able to activate Data Events for entities

    Yesterday I looked into an issue for one of my customers. In one of their environments they where not able to activate Data Events for any of their entities. The Activate button was completely grayed out and the “Active Data Events” and “Inactive Data Events” tabs did not exist

    This is an environment where we are currently running a PoC for DualWrite so I just “assumed” that I had configured PowerPlatform correctly (you know what we say about assumptions)

    Turns out I had not followed my own advice and done the PowerPlatform configuration from LCS… Instead I did the linking from within FnO, in the DataManagement workspace.

    The solution was to go through the linking wizard in LCS and then the tabs showed up



    Note that the change to the Business Events Screen is not instant… I had to have it sitting over night to have the tabs show up

    Links:
    Figuring out DataVerse and DualWrite in Dynamics 365 FnO – JohanPersson.nu

  • User Access issues to Synapse Serverless Views

    I just set up the CDMUtil for a customer to let them access Dynamics 365 for Finance and Operations Data, exported to a DataLake, through a serverless instance in Synapse. The customer had added a new user and got an error which vas not perfectly logical

    Msg 15151, Level 16, State 1, Procedure CustTable, Line 1 [Batch Start Line 0]
    Cannot find the CREDENTIAL 'dynamics365_financeandoperations_XXXXXXXX_sandbox', because it does not exist or you do not have permission.
    Msg 4413, Level 16, State 1, Line 223
    Could not use view or function 'dbo.CustTable' because of binding errors.

    The issue was obiously a permission issue… but where??

    When we added an earlier user we set up a Role in SQL that had read access to the SQL DataBase. When we added the user to that role it started working… The confusing part was that the error message did not mention the new user anywhere.

    When you set up the Synapse connection to Data Lake and FnO… Make sure you add the correct permissions to new SQL-Native users using TSQL in Management Studio.

  • UPDATED: Configuring access for mobile warehousing app in Dynamics 365 for Operations

    Back in 2018 I wrote an article on how to configure a D365FO instance to enable the Warehousing App. A lot of time has passed and tonight I will set up the all new and improved Warehouse App so I thought I would also take the time to update the original article

    1. Go to the azure portal. In Azure Active Directory – App Registrations create a web application for the warehouse portal
      Name: WhatEverYouWant
      Who can use thisapplication or access this API: Accounts in this organizational directory only
      Application Type: Web app/API
      Sign-on URL: https://[theURLforyourdynamicsinstance]/oauth
    2. Open the application to edit it
    3. Verify Application ID. Save this for later…
    4. Go to API Permissions and click Add a permission
    5. Select the API called Microsoft Dynamics ERP (Microsoft.ERP)
    6. Choose Delegated Permissions
    7. Under Permission to other applications click add application and add Microsoft Dynamics ERP
    8. Add the following permissions
      – Access Dynamics AX online as organization users
      – Access Dynamics AX data
      – Access Dynamics AX Custom Service
      Click Add Permissions
    9. Click Grant admin consent for [Your Organization] and confirm your choice
    10. Go to Certificates and Secrets and click New client secret. Select an expiration and give the key a description like D365FO Warehousing App
    11. Log into Dynamics 365 for Operations and go to System Administration – Users and create a new user (in my case called WMAPP. The email address can be anything since it will never be used. The user needs this role:
      – Warehouse mobile device user
    12. Now we need to associate the user to the AD Application which is done on System Administration – Setup – Azure Active Directory applications. Here we paste the App ID/ClientID from before and select the user we created. Click Save and you are done.
    13. Install the App from app store and enter these settings:
      1. Azure Active Directory ID: AppID/ClientID from step 3
      2. Azure Active Directory Client Secret: The key from step 10
      3. Azure Active Directory Resource: Your Dynamics 365 URL
      4. Azure Active Directory Tennant: https://login.windows.net/yourAzureADtennant.onmicrosoft.com
      5. Company: Dynamics 365 for Operations Legal Entity
    14. To configure the mobile att you create a JSON file with the connection setting
    {
        "ConnectionList": [
            {
                "ActiveDirectoryClientAppId":"11111111-2222-3333-4444-111111111111",
                "ConnectionName": "YourConnection",
                "ActiveDirectoryResource": "https://{[yourdynamicsenvironent].cloudax.dynamics.com/",
                "ActiveDirectoryTenant": "https://login.windows.net/[yourtenantid].onmicrosoft.com",
                "Company": "USMF",
                "IsEditable": true,
                "IsDefaultConnection": true,
                "ConnectionType": "clientsecret"
            }
        ]
    }
    1. The JSON file can either be uploaded to the device or converted to a QR code using a service like this.
    2. Unfortunately/Thankfully the client secret cannot be put in the file/QR code and it have to be entered manually by editing the connection on the mobile device.
    3. To login in to the app you will need to have a username and password. Go to Warehouse Management – Setup – Worker – Users and select a user (in my case 24). Reset the password for worker 24
    4. Login to the app using User ID 24 and the new password you just set

    Note:
    To use the new Warehousing App you will need to enable a feature i D365FO called User settings, icons, and step titles for the new warehouse app which is available from 10.0.17

    Links
    Install and connect the warehouse app – Supply Chain Management | Dynamics 365 | Microsoft Docs