Announcements
We are facing an issue with a custom multithreaded batch job in D365FO that processes data and creates transfer/movement journals.
The error occurs during standard journal posting logic:
Violation of PRIMARY KEY constraint 'I_7874ITEMDIMIDX'. Cannot insert duplicate key in object 'dbo.INVENTSUM'.
The problem occurs when multiple threads try to update the InventSum table simultaneously, leading to the error.
Exception handling is in place, including Exception::DuplicateKeyException
, but the error is not being caught. Some records remain unprocessed due to this failure.
Has anyone encountered a similar issue with InventSum in multithreaded processing? What best practices can be followed to handle concurrency on InventSum and prevent duplicate key conflicts in a multi-threaded batch job?
Looking forward to insights from the community. Thanks in advance!
André Arnaud de Cal...
293,356
Super User 2025 Season 1
Martin Dráb
232,508
Most Valuable Professional
nmaenpaa
101,158
Moderator