microsoft / BCApps

Repository for collaboration on Microsoft Dynamics 365 Business Central applications.
https://microsoft.github.io/BCApps/
MIT License
325 stars 171 forks source link

[Bug]: Document Check factbox stopps working when logging more than one custom error via error message management #2406

Open TobiDynDev opened 17 hours ago

TobiDynDev commented 17 hours ago

Describe the issue

When extending the Document Checks enabled via the Data Check field in the General Ledger Setup page with more than one error logged via the error message management the Factbox does not refresh anymore. The issue just happens in case at least another check is logged already via the Error.Info.

Expected behavior

To be able to extend the performed document checks with multiple error messages logged via the error message management.

Steps to reproduce

Additional context

The issue is due to the GetErrors and CollectErrors procedures: Image

At the end of GetErrors happens a findfirst - and TempErrorMessage points to the first record Image

Within collecterrors, the record TempLineErrorMessage points to the first record and it is tried to Insert the by the base app generated errorinfo error with the same ID which was used to log the "2nd error message" Image

I will provide a fix for a bug

JesperSchulz commented 11 hours ago

Sounds like a bug. Approved.