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

Data Events issues after refresh

In a previous article I wrote a bit about Data Events in Dynamics 365 for Finance and Operations. Data Events is a really simple way to create event-based integrations based on changes in the different data entities in FnO. The Data Events functionality is based on functionality in Power Platform. The setup requires the installation of the Finance and Operations Virtual Entity solution in the Power Platform environment connected to FnO. When you create a trigger Data Event it also created a virtual entity in DataVerse. This creates a couple of challenges when it comes to refreshing databases between environments.

For FnO
The settings for the endpoints created in FnO are partially stored in FnO and partially stored in an Azure Key Vault. The settings stored in FnO are amongst others Key Vault URL, App registration ID and Secret. To make sure that these settings do not get extracted from the environment (or accidentally moved to another environment) they are encrypted using an environment specific key and are thus not readable in the destination environment for the refresh. To restore the functionality of Data Events in the destination environment the endpoints need to be removed and recreated. After that has been done, we can re-activate the triggers.

Note that broken endpoints create an issue even if they are not being used. It seems like all endpoints are being validated when you try to create a new one which results in the creation failing.

For DataVerse/CRM
Since the functionality of Data Events is based on Virtual Entities created in DataVerse these will be overwritten when a refresh is done from one DataVerse environment to another. The error message you will get when the event is triggered is this:

Response status code does not indicate success: 404 ({“error”:{“code”:”0x80048d02″,”message”:”Virtual entity ‘mserp_vendvendorbankaccountentity’ not found for external entity VendVendorBankAccountEntity”}}).

(of course, with a different entity name based on your scenario)

The solution is to go to the Active Data Events tab in the Business Events workspace and remove and recreate each Data Event Trigger.

Note. You might have to wait a moment (1 minuter or so) before you recreate the trigger in order for everything to be properly cleaned in DataVerse.

Note: I have not been able to verify what happens if the identical triggers are set up in both source and destination environments. It might be that there are no issues or we might have the same issue. If anyone knows, please let me know 🙂

Lessons Learned: There has always been a lot to think about when you do refreshes… And DataVerse integration/DualWrite adds even more. There is a great article by Faisal Fareed here that detail steps that needs to be done for DualWrite integrated environments.

Links:
Not able to activate Data Events for entities – JohanPersson.nu
Microsoft Dynamics 365 and Power Platform Library: Steps to follow when refresh dual-write integrated environments (FO and CE) (daxture.blogspot.com)

Finding Electronic reporting files

I really like the fact that there is an entire reporting framework built in to Dynamics 365 for Finance and Operations.

Today I got a questions from a colleague about where the files generated by Electronic Reporting. Since I had not done this before I am documenting it here.

Go to Electronic Reporting Jobs for the correct legal entity

Select the job and click Show Files

Select the file you want and click Open

Links:
Electronic reporting (ER) destinations

AX 2012 Reporting Services Troubleshooting – Part 2

In the last post I was troubleshooting the SSRS connection from AX 2012. I was quite happy when the settings validated correctly but I was still not able to run the report… I got this error:

Error while setting server report parameters. Error message: The DefaultValue expression for the report parameter ‘AX_CompanyName’ contains an error: Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed. (rsRuntimeErrorInExpression)

After some googling researching I found someone having the same issue (link below).

Apparently you need to change the PermissionSetName in the rssrvpolicy.config file on the Reporting Server. Start Notepad as administrator and open the file from the folder C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer (you should probably back it up first).

Change this:
<CodeGroup class=”UnionCodeGroup” version=”1″ PermissionSetName=”Execution” Name=”Report_Expressions_Default_Permissions”

To this:
<CodeGroup class=”UnionCodeGroup” version=”1″ PermissionSetName=”FullTrust
Name=”Report_Expressions_Default_Permissions”

That is all for today

Links
SSRS Report Error – AX_CompanyName – DAXNigel (wordpress.com)

AX 2012 SSRS Troubleshooting

Today I got the following message… “Could you just fix the reports on this AX 2012 environment… It is broken”

Then I tried to validate the report configuration I got the following error:

The SQL Server Reporting Services server name [servername] does not exist or the Web service URL is not valid.

OK… First test:

Can I browse to the report URLs in System Administration – Business Intelligence – Reporting Services – Report Servers.

No I could not, from the AX Server. it worked from the SQL Server so I checked the firewall on the SSRS Server and added port 80.

I still get the same issue when validating. So I opened the Microsoft Dynamics AX 2012 Management Shell as an administrator and ran Test-AXReportServerConfiguration

What… I opened the port and I can browse to the URLs. Apparently the as scripts tests for Remote Admin Ports so when I open those ports using this netsh command

netsh.exe firewall set service type=REMOTEADMIN mode=ENABLE scope=ALL

Presto!! The validation was successful!!


Links
Configure a Report Server for Remote Administration

Working with XSD files in AX 2012

Today I got a question from one of my colleagues… The needed to sent a complete AIF port specification to an external service provider and the XSD (XML Schema Description) the could find only contained the internal AX Types and it specifically lacked the information about maximum length for the fields.

Since I am not a developer and I am not that knowledgeable in the AOT I reached out to a couple of out developers. Thet is when I learned about Shared Types Schema . This contains the complete list of types and it also acts as sort of a translation table for the regular XSD and which is merged the exploring the service.

Not to self (once I forget this): The reason for having all the extended types in the original XSD is because we are able to change the field setup in AX and having it propagate to the entire system.

To get to the XSD for the AIF port you go to the port (System Administration – Setup – Services and Application Integration Framework). Select the port, verify that Customize Document is checked and clock Data Policies

Click on View Schema

Here you can see the XSD for the port. If you click Imported Schema you will open up the Shared Types Schema. Save both the regular Schema and the Shared Schema and send it to whoever needs it

Links
About the Shared Types Schema

DualWrite syncing empty lines on Initial Sync

I had this strange issue today…

One of my customers have set up DualWrite in their DEV environment and after some tweaking it worked OK. With that done they wanted to move the entire solution into TEST and verify that it worked. We packaged all the mappings into a Solution, exported it from DEV and moved it into TEST. We started enabling the Mappings for Legal Entity and a when we looked in CRM/CE we had a bunch of empty lines. We had the same number of lines but all of them were empty.

If we changed the data on one of the Legal Entities it synced over just fine but all the rest were still empty.

When we looked into the DMT files for the data project for the initial sync the files looked “good” to me… they contained data

|NAME|,|LEGALENTITYID|
|LegalEntity1|,|AAA|
|LegalEntity2|,|AAB|
|LegalEntity3|,|AAC|
|LegalEntity4|,|AAE|
|LegalEntity5|,|AAF|
|LegalEntity6|,|AAG|
|LegalEntity7|,|AAH|
|LegalEntity8|,|AAI|
|LegalEntity9|,|AAJ|
|LegalEntity10|,|AAK|
|LegalEntity11|,|AAL|
|Company accounts data|,|dat|

Some of you might already see the issue 🙂 (don’t spoil the surprise) When contacting Support they told me then there is a problem with the text qualifier in the file… the strings should be enclosed in ” instead of |

It turns out that someone had changed the default format CSV-Unicode in Data Management Framework to this:

I changed it back to this:

After cleaning out the records from CRM/CE and rerunning initial sync everything works again…

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

Figuring out DataVerse and DualWrite in Dynamics 365 FnO

This is a (probably the first) post to try to sort out my experiences around setting up a DataVerse connection to a Finance and Operations environment and figuring out how this interacts with Power Platform Admin Center, LCS and DualWrite.

Background

DualWrite is Microsofts go-to solution for integrating Dynamics 365 CE and Dynamics 365 FnO. It uses Dataverse and PowerPlatform extensively which means that we are, in all essences, merging two separate products into one, which creates some challenges.

Since Microsoft is in the middle of a “Convergence” transition when it comes to managing these things I realize that this is a moving target at the moment, which is why I will need to come back to this this eventually.

This article will address some of the challenges that we have experienced, setting up DualWrite.

Since my primary focus is FnO I will start there.

There are a lot of clues to the fact that Microsoft sees PowerPlatform and DataVerse as an integral part of Dynamics 365 for Finance and Operations. The first one you will notice is that you get the option to create a Power Platform environment when you create a new FnO environment. Another lead is that none of the microservice add-ins that you can deploy from LCS are available to deploy it you have not connected your environment to Power Platform.

There are two different ways to create the DualWrite setup. Setting up a new, empty Environment when deploying a new FnO environment or linking your FnO environment to an existing CRM/CE environment. Please remember that, if you have an existing CRM environment with existing customizations (of a highly customized FnO environment) you should probably think about setting up a proof of concept to evaluate how to handle customizations. Keep in mind that the out-of-box mappings for DualWrite are created for vanilla environments.

Initial Setup

When setting up a new Finance and Operations environment you get the option of also setting up a new connected DataVerse environment. You will not get the option to connect an existing environment. You are able to opt out of this setup at the time of deployment if you want.

Regardless of what you choose the environment will be created and connected from the Power Platform side. On the LCS side there is no indication of any DataVerse environment.

Connecting to PowerPlatform

NOTE: This decision is IRREVERSIBLE. Once you have linked your FnO environment to a Power Platform environment there is no supported way to unlink it.

Once the environment is set up LCS offers an option to set up the DataVerse Connection. You can use the one provisioned for you, if you are not using CRM or if you are not planning to use DualWrite to interface with CRM, or you can link it to your existing Dynamics 365 for Sales (CRM) environment. Even though the connection is done to your existing/live CRM environment the operation should be safe since the Power Platform are being deployed to another “partition” of the environment. I know, the message in the upper right corner looks a bit scarry…

This operation only enabled the install of add-ins, DualWrite still needs to be set up from within FnO when you are ready for it.

Lessons Learned

Since Microsoft is currently moving the management experience of Dynamics 365 for Finance and Operations environments to the Power Platform Admin Center, all of this is a changing scenario and I think what we are seeing is a transition to what is about to come.

Key Take-Aways

  • Do a gradual rollout, starting with some entities
  • If there is data that does not need to be synchronized, a different solution such as virtual entities or PowerApps could be an idea
  • Do a proof-of-concept to validate the setup

Links:
Enable integration during environment deployment
Microsoft Power Platform integration with Finance and Operations apps – Finance & Operations | Dynamics 365 | Microsoft Docs

Enable vs Enabled Features

I have learned that it is important to read the fine print… otherwise you will miss things. This happened to me and a colleague the other day.

In Dynamics 365 for Finance and Operations, Microsoft add new features all the time. These are controlled in Feature Management workspace where you can also read up on the new features to understand important impact.

A cool feature is that there is a Data Entity in the Data Management Framework which exports and imports the feature set for a given environment and enables moving feature settings from one environment to another making easier to manage the lifecycle of your features and sync them with for instance releases

Now comes the part that I completely missed (which in hindsight is quite obvious):

There is a column called Enable Date, which I thought meant “The date the feature was enabled”, what it actually means “The date the feature is enabled”… notice the subtle difference?? I did not 🙁

What the column actually does is to set a schedule for when the feature will be enable. When you use DMF to import a list of feature settings with this field set means that you will schedule the enablement of the feature. It is a great feature but might cause some issues if you are not aware of it. Especially for features that can not be turned off.

Remember: Read and understand the fine print