Forecloud Technologies Pvt. Ltd. - Workaround-Amount Rounding Precision Error on General Ledger Setup
Solving the Error: You cannot change the contents of the Amount Rounding Precision field because there are posted ledger entries.
Error: You cannot change the contents of the Amount Rounding Precision field because there are posted ledger entries.
Introduction:
If you've ever tried to change the amount rounding precision in the General Ledger setup in Microsoft Dynamics 365 Business Central and encountered the error ‘You cannot change the contents of the Amount Rounding Precision field because there are posted ledger entries’.
In this blog, I'll show you how to work around this error using AL language, allowing you to change the rounding precision without any issues.
Pre-requisites:
- VS Code
- Business Central Environment
Error:
- When you tried to change the rounding precision from the General Ledger Setup page, Business Central throws the error message mentioned above. This happens because posted ledger entries have already been created using the current rounding precision value, and the system does not allow modifications to this field once those entries exist.
- If we debug this error, this is coming from CheckRoundingError procedure from table 98 "General Ledger Setup"
Solution:
- To resolve this issue, we can create an AL codeunit that subscribes to the event associated with Table 98 (General Ledger Setup). We’ll use the OnBeforeCheckRoundingError event to avoid the error and allow changes to the rounding precision value.
- Set the ErrorMessage value to false to prevent the error from being thrown. This will allow us to change the rounding precision without any issues.
- This allows us to modify the rounding precision value (e.g. changing it from 0.01 to 1) even when posted ledger entries exist.
Conclusion:
With this solution, you can now change the Amount Rounding Precision in the General Ledger Setup without encountering the error.
This workaround is a great way to bypass restrictions in Business Central when you need to update your rounding precision settings, especially in environments with existing transactions.
Prathama Deshpande
Prathama Deshpande is a dedicated Business Central Developer working with Forecloud Technologies since 2023. She is one of the key responsible person for Business Central Customization Development and Functional Implementation and Support.
No comments yet. Login to start a new discussion Start a new discussion