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
Enable the Data Check in General Ledger Setup
Use the Document Check FactBox
Create a new Purchase Order with a Vendor, a purchase line with an item and a quantity.
Now the document check should have one error: "You need to enter the document number of the document from the vendor in the Vendor Invoice No. field, so that this document stays linked to the original."
Add code to the OnAfterCheckPurchDoc subscriber event of the Purch.-Post codeunit:
It is not possible to Refresh the factbox anymore. With just the 1st. error the refresh is possible.
Additional context
The issue is due to the GetErrors and CollectErrors procedures:
At the end of GetErrors happens a findfirst - and TempErrorMessage points to the first record
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"
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
Enable the Data Check in General Ledger Setup
Use the Document Check FactBox
Create a new Purchase Order with a Vendor, a purchase line with an item and a quantity. Now the document check should have one error: "You need to enter the document number of the document from the vendor in the Vendor Invoice No. field, so that this document stays linked to the original."
Add code to the OnAfterCheckPurchDoc subscriber event of the Purch.-Post codeunit:
It is not possible to Refresh the factbox anymore. With just the 1st. error the refresh is possible.
Additional context
The issue is due to the GetErrors and CollectErrors procedures:
At the end of GetErrors happens a findfirst - and TempErrorMessage points to the first record
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"
I will provide a fix for a bug