Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
TobiDynDev opened this issue Nov 26, 2024 · 3 comments
Labels
Approved The issue is approved SCM GitHub request for SCM area

Comments

@TobiDynDev
Copy link

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:
    Image

  • 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:
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

  • I will provide a fix for a bug
@TobiDynDev TobiDynDev added the Bug Something isn't working label Nov 26, 2024
@JesperSchulz
Copy link
Contributor

Sounds like a bug. Approved.

@JesperSchulz JesperSchulz added Approved The issue is approved SCM GitHub request for SCM area labels Nov 26, 2024
@aholstrup1 aholstrup1 removed the Bug Something isn't working label Nov 27, 2024
@TobiDynDev
Copy link
Author

@JesperSchulz i just recognized that the error message management is not part of the system app - but it's part of the base app in the system folder.
I will close this issue and create a new one in the BusinessCentralApps repository

@JesperSchulz
Copy link
Contributor

I could have transferred it, but creating a new issue will do the trick too 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved The issue is approved SCM GitHub request for SCM area
Projects
None yet
Development

No branches or pull requests

3 participants