Overwrite a read-only configuration in D365FO

Overwrite a read-only configuration in D365FO

Updating an arbitrary read-only field in a configuration table in may pose a challenge in Dynamics 365 for Finance and Operations, especially in the production environment.

Many options may only be set once, for example the Use warehouse management processes mode of a warehouse, or the Revenue recognition accounting rule in a project group. Yet the data export / import both in D365FO and AX2012 may bypass the AOS validation as long as a data entity exists.

Here is how: open the Data management workspace and create an Export data project. Pick the respective data entity. Optionally, reduce the number of exported fields in the mapping to the minimum: the entity key and the read-only parameter in question.

Drill down into the Entity structure and turn off the Run business validations checkbox:

Then use the Modify target mapping button to clear the Call validate Field method checkbox from the entity attribute:

Export the data, download the ZIP data package, extract the Excel file and amend the parameter in the file as desired. Then re-pack the ZIP data package with the updated file (replace the original), create an Import data project, upload and import the package. With a high probability the Data management engine is going to bypass any application logic and update the existing record without further asking.

As a matter of fact, this method is even more brutal than the table browser (RIP, dear table browser, you are truly missed), since it ignores field properties set at the table metadata level and breaks the database consistency.

Electronic Reporting (ER) Cookbook 2: new tips from the kitchen

Electronic Reporting (ER) Cookbook 2: new tips from the kitchen

Since my last blog in 2017 a few things have changed. The developers in Moscow have been extending the module massively, and they seem to have fully embraced the Continuous delivery approach. Every new version or hotfix bears surprises, both pleasant and unpleasant. Here is a small personal excerpt:

      1. Configurations may be declared dependent on a particular application version or even hotfix. Should the developer of a configuration have failed to declare a dependency, the following message may appear on an attempt to import the configuration: “Method parmXXX not found in class ERxxx”, for example “Method parmERTextFormatExcelTemplate not found in class ERTextFormatExcelFileComponent”. It means the configuration definition cannot be de-serialized from an XML file in this old application version.
      2. From version 7.3 onward, parts of the application logic of the ER module had been extracted to the Microsoft.Dynamics365.LocalizationFramework .NET assembly for better performance. Now not only the configuration relies on a particular application version, but the application too demands a certain binary hotfix. For example, the SEPA camt.054 bank statement requires application hotfixes KB4096419, KB4092831, KB4089190, KB4077379, while the designer UI will not start without the ER cumulative update KB4090174 i.e. binary version 7.0.4709.41183
      3. From version 7.3 it had become possible to create inbound electronic formats i.e. those reading files instead of writing them. In 7.2 you could configure the same, but it was simply failing to work properly. It was not giving you any errors but failing to traverse records in the CSV file.
      4. Since version 7.2 you may define a Sharepoint folder destination (Organization administration > Electronic reporting > Electronic reporting destination). Consider the following scenario: the electronic report runs in a batch and saves files in a Sharepoint folder. A client-side process synchronizes the folder with the local network, and a local daemon picks up the files to push them through a legacy banking software or a tax authority middleware.
      5. When reading or writing data in D365FO, the ER is able to scan 1:n and n:1 table and entity relations for foreign keys. However, your new tables and entities are not going to appear under the Relations node of the data model mapping in the Designer, as the ER module maintains its own list of table relations in the database. Even worse, it may import and run a custom configuration with no errors but silently skip the custom table on reading and writing. Apply Organization administration > Electronic reporting > Rebuild table references to make your custom tables available.
      6. When developing or customizing configurations, it is not necessary to Complete the versions every time to test them. The ‘integration point’ e.g. a payment journal may execute the latest Draft version of the format too. Use the button Advanced settings / User parameters / Run settings, then flip the Run draft slider that appears.
      7. After upgrading to 7.3 you may find yourself unable to edit configurations anymore. The reason may be the new parameter Enable design mode available at the Electronic reporting workspace, form Electronic reporting parameters.
      8. It seems that they’ve protected configurations made by Microsoft from editing in one of the recent updates. Instead, you are supposed to always derive a configuration from the base one, and assign it a custom Provider. This corresponds to the extension paradigm as opposed to ‘overlayering’ of a configuration. Now, what are you going to do with your existing customized formats? Create an own provider (Organization administration > Electronic reporting > Configuration provider table), give it a name and a web address of your organization. Make this provider Active at the ER workspace. Export your configuration into an XML file, then delete it from the list of solutions in ER. Replace the XML tag with your provider, then re-import the configuration from the file. The system creates a new Draft version you are now able to edit.

Copy-paste with keyboard script 2: from Excel to D365FO

Copy-paste with keyboard script 2: from Excel to D365FO

Again an entity was missing in D365FO to import the data, this time a custom one. Building upon my work Copy-paste automation in D365 FO with a keyboard script, I created a Wunderwaffe script to copy a simple table with a Code and a Description directly from Excel into the D365FO browser window.

Close all other windows and put the browser with D365FO and Excel side by side. Place the cursor in Excel in the Code column at the first row to copy, then hit Ctrl-J. The script will start copying data from Excel and pasting records in D365FO by switching windows forth and back:
^j::
; --------- Place the focus on the code column in Excel, start with Ctrl-J
Loop 200 {
; --------- Copy the content of the Code from Excel
Send, ^c
Sleep, 500
; --------- Switch the window: Alt-Tab
Send, !{TAB}
Sleep, 1000
; --------- Create a new record in the D365FO window
Send, {Alt Down}
Sleep, 500
Send, n
Sleep, 500
Send, {Alt Up}
Sleep, 1000
; --------- Go to the next field and back in the D365FO to get into the edit mode
Send, {TAB}
Sleep, 1000
Send, +{TAB}
; --------- Paste the code
Send, ^v
; --------- Switch the window and go back to Excel
Send, !{TAB}
Sleep, 1000
; --------- Copy the content of the Description column from Excel
Send, {Right}
Send, ^c
Sleep, 1000
; --------- Switch the window for D365FO
Send, !{TAB}
Sleep, 1000
Send, {TAB}
Sleep, 500
; --------- Paste the description
Send, ^v
; --------- Switch the window for Excel
Send, !{TAB}
Sleep, 1000
; ---------Scroll down to the next record, and repeat the cycle
Send, {Down}{Left}
}
Return
; Press F1 in panic
F1::ExitApp