
Customer invoice falsifier for D365 for Finance
In certain business scenarios, it may become necessary to update and reprint customer invoice Dynamics 365 with corrected or intentionally adjusted figures. By selectively mapping only specific invoice header and invoice line fields for update, the configuration enables targeted adjustments without triggering recalculations of dependent totals. The electronic reporting configurations may also be used as a tutorial for the Excel imports in D365.
Check the above screenshot: assuming we’ve initially issued an invoice with 19% VAT instead of the reduced 7% VAT, the SalesBalance and SumTax may be shifted while keeping the total invoice amount the same. Beware: to reflect the VAT manipulations in the tax books a separate [cumulative] GL journal must be posted manually. Please ensure any misaligned invoice reprints are clearly marked as adjusted copies to avoid confusion or compliance issues, though.
The underlying method uses the Electronic Reporting import configuration capabilities in Dynamics 365 for Finance. You may download the ER configurations here: CustInvoiceUpdater.zip. Unpack and import into the ER tree one by one, starting with the model. Use it at your own risk!
Key elements include:
- Data Model – definition of the conceptual invoice structure (header amounts, line amounts, tax values, etc.).
- Model Mapping for export and a model mapping To destination for the import (both in the same model mapping ER configuration) – links the data model fields to the relevant Dynamics 365 tables and columns.
- Formats – define the export file structure (Excel) and the same import file structure and maps the file’s data to the model fields.
For a detailed description of the ER import concept and practical configuration guidance, check Electronic Reporting in Data Migration.
The process follows a three-step cycle:
-
Export – Extract invoice data from Dynamics 365 into an Excel using the “CustInvoiceJourDump format” ER export configuration.
-
Adjust / Transform – Modify the extracted data in Excel, changing selected amounts while leaving others untouched.
-
Import – Re-import the adjusted file by selecting the “CustInvoiceJour mapping” in the ER tree, clicking Designer, then Run at the “To destination” mapping, and uploading the Excel file. If the file is well formed and there is a match for the RecId of the invoice header/line, it updates the table in Dynamics 365 and says “Operation completed“.
In this scenario, the import mapping is deliberately limited to only 3 or better to say 6 amounts, both in the transaction currency and the accounting currency (the “MST” amounts): Sales subtotal amount, Total charges, VAT amount. A built-in validation ensures these three values still sum to the original invoice total, maintaining internal consistency while allowing the reprint to reflect updated breakdowns.
The “CustInvoiceTrans mapping” for invoice lines does not have this safeguard, since the invoice lines to not hold grand totals in D365.
The total invoice amount field was intentionally excluded from the update, because this may lead to a mismatch between the general ledger and the AR subledger.
Dynamics 365 tips and tricks
Further reading:
SysFlushAOD: Refresh SysExtension cache in D365FO
Batch jobs in D365: a Russian roulette
Cross-company data sharing vs. Duplication in Dynamics
Refresh master data cache in D365FO
Number of records in D365
Overwrite a read-only configuration in D365FO
Copy-paste automation in D365 FO with a keyboard emulator
Make yourself an Admin in Dynamics 365 Fin/SCM
Exposing Dynamics 365 Onebox to the LAN