Monday, August 31, 2026

D365 SCM: Inventory Recalculation taking nearly 24 hours

Recently one of our clients faced an issue with preformance of inventory recalculation. For this customer snardard MS Inventory Recalculation was taking nearly 24 hours. 

Based on the investigation, the following was determined. 

A recalculation run has three phases:

  1. building the item list is normally quick 
  2. calculation itself is efficient
  3. processes settlement records one at a time
That final step processes settlement records one at a time, not as a bulk operation. The standard Microsoft code (class InventAdjustPost, method updateItem()) opens a query over the settlement records and loops through them individually.

The one-record-at-a-time loop is in standard product code and cannot be changed by configuration. This is the main cause and it needs a Microsoft support case.

Despite the fact that there is a bottleneck in the MS code, there are several options that can be done to improve performance. 

One of them is to enable parallel processing for the calculation phase.

When Extra batch helpers is set to 0, it means that the calculation runs on a single thread. The recommendation is to set it to 4–8 and pointing the helper batch group at a group that has a batch server behind it. This is a settings change, not development. It would speed up the calculation phase only roughly a third of the run. It is cheap and safe, but it does not solve the main problem.

Go to Inventory and warehouse management parameters > Inventory accounting tab, Extra batch helpers field.

Second improvement is to clean up the batch framework tables.

Check how many failed batch tasks and failed batch jobs you have, and clean them up. It affects all batch processing, not just inventory recalculation.

Wednesday, August 26, 2026

D365 SCM outputs to PDF instead of screen on reports containing big amout of data

Description: D365 SCM outputs to PDF instead of screen on reports containing big amout of data

This is standard OOB behavior. If there is a need to a prevent this logic:

1) filter data in the report so tha report does not contain a big amount of data

or

2) Disable "Report PDF viewer" feature

Reference: SSRS Report, Output PDF D365 F&O - Finance and Operations/AX / General discussions - Dynamics User Group



Monday, March 30, 2026

How to resolve MS 10.0.47 D365 SCM issue with project transaction adjustment

During upgrade testing of 10.0.47 the following issue was identified in the Adjust project transaction functionality. 

The Adjust Transaction option does not work, showing the notification message:

Cannot edit a record in Project adjustments (TmpProjAdjustment). The record has never been selected.


To resolve this issue on DEV/TEST where access to SQL exists, please disable the ProjAdjustmentSelectPerformanceFlight via SQL :

INSERT INTO dbo.SYSFLIGHTING(FLIGHTNAME, ENABLED, FLIGHTSERVICEID)VALUES ('ProjAdjustmentSelectPerformanceFlight_KillSwitch', 1, 12719367)

To resolve this issue on PROD, Microsoft support request must be logged and Microsoft will do it for you.

Thursday, November 6, 2025

Open in Excel is not working on DEV BOX (Microsoft Dynamics 365 SCM)

When I tried to open in Excel on the on-premise dev environment, I encountered the following issue:

Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA' | Network client threw: Failed with status 400 | Attempted to reach: 


To resolve it, I had to use web version of Excel

Then you need to upload the file that was downloaded from Microsoft Dynamics 365 SCM

Expense Report Workflow Fails with X++ Exception: Cannot create a record in Alerts - event inbox data (EventInboxData)

Description

Recently I experienced the following issue:

Expense Report Workflow Fails with X++ Exception: Cannot create a record in Alerts - event inbox data (EventInboxData) 

Steps to review the error messages: 

1. Navigate to: Expense management > Process expense reports > All expense reports (Note: user must be linked to an employee record to see the data) 

2.Create expense report and Submit it.

3. After submitting to workflow, workflow will fail.

Stopped (error): X++ Exception: Cannot create a record in Alerts - event inbox data (EventInboxData). Inbox ID: 5637144754. The record already exists.


Resolution:

Error occurs because the workflow tries to create a duplicate record in the EventInboxData table using an Inbox ID that already exists.

Resolution: Delete the inactive records from the EventInboxData table.


Additional details were found here:

Exception: Cannot create a record in Alerts - event inbox data (EventInboxData) - Dynamics 365 for operations - v23

X++ Exception issue during Workflow creation

Exception has been thrown by the target of an invocation

I have recently experienced an issue on MS 10.0.45 in Microsoft Dynamics 365 for Supply Chain Management. While posting project invoice proposal for sales order, an error message is thrown "Exception has been thrown by the target of an invocation". This issue is not reproducible on MS 10.0.43, only on 10.0.45. I have validated the same scenario on clean/vanilla F&O on MS 10.0.45 and the same issue exists.  

After debugging this issue, it is showing an error:

System.MissingMethodException: 'Method not found: 'Void Microsoft.Dynamics.Commerce.Headquarters.Instrumentation.CommerceHQEventSource.EventWritePaymentsInvoiceEndUpdateStart(Int64, System.String, Boolean)'.'

This seems to be related to the following issue:

https://fix.lcs.dynamics.com/Issue/Details?bugId=855772&dbType=3&qc=d9cbf941a333782909abd105d654b4394a74f245c259530d6d9f650effac53fa

In our case the resolution was to swap dlls with newer version. By taking dlls from "Retail" model and replacing existing in "ApplicationSuite" model. 

Wednesday, January 15, 2025

D365 SCM Moving average: High-level overview

 Moving average is a costing method that works on average principle, meaning it calculates the average cost of inventory in stock. 

Average cost of each inventory item in stock is re-calculated after receiving inventory via purchase orders or any other inbound documents. So formula is the following:

The moving average cost = the total cost of items purchased / the number of items in stock.

Let's look at the example below:


With these transactions, the moving average cost at the 9/16/2024 was 100$, but at the 9/18/2024 was 120$.
Calculation for the 9/18/2024 = (10000+18000)/(100+150) = 112
If we sell the product, the cost of goods sold would be 112$.

In the scenarios above, the sales order was posted before posting of the invoice for purchase orders
So what will happen when invoice is posted for the purchase order and invoice price has been changed. 

What happens in D365 in this scenarios.
Purchase order transaction:
Let's charge 105.00 per unit for the item, not 100.00 as it was originally in the product receipt.


When we post invoice and invoice price is different, the following voucher will be created:
If the invoiced quantity is still on hand, the full difference between the invoiced amount and the receipt is recognized as an inventory cost.
If only part of the quantity is still on hand, the system performs a proportional calculation at the time of invoicing.

In our scenario, part of the quantity was sold already. The additional cost of 5.00 per unit cannot be related to the sales order, because the sales order is already costed when you receive the invoice for the purchased items. Therefore, the system performs a proportional calculation, and the expense of 400.00 ([105.00 - 100.00] × 80 units) is expensed on the Price difference for moving average account. So 400$ expensed and the remaining 100$ will be recognized as inventory cost and Financial cost that will be posted on transaction is 10100$ instead of 10500.

Moving average cost recalculation:
As soon as we post invoice, Cost is recalculated and now, it is not 112$, but 112.59$.
The calculation is the following: (10100+18000-8960) / (100+150-80) = 112.5882 

Sales order transaction
It does not update/recalculate issue transaction, it does not post adjustment transaction. 

Inventory close does not affect products that have moving average as the inventory model group, and it does not generate any settlements between the transactions. So it means that posted sales orders will stay unchanged. 

Moving average is typically a good fit for the following scenarios: 
- All units of the same product family carry the same cost
- There is no need to recalculate the inventory transactions to adjust the costs on outbound transactions. 
- There is no need in inventory closing
- Data entry on purchase orders is accurate and in timely manner and no significant difference between purchase price and invoice price.