I have a Logic App that reads data from an Azure SQL table and creates a GL Journal in D365. This works 90% of the time but every once and a while (a couple times a week) one of the entries in the journal lines will fail with this error:
An error has occurred. Write failed for table row of type 'LedgerJournalLineEntity'. Infolog: Info: Cannot create a record in Journal lines (LedgerJournalTrans). Journal batch number: JBN0018064, ARR000140052.\nDeadlock, where one or more users have simultaneously locked the whole table or part of it.
The rest of the lines before and after the failed record write just fine.
I have tried playing with the Concurrency control (setting it to 1) but that did not help. Someone suggested that if I included the line number in my supplied values it would fix this but I cannot figure out how to do that (it is not one of the fields available, and even if I go into code view and try it says it is not a field that can be populated). Thanks.