Skip to content

[Bug]: All decimal fields behaves as amounts by default #25329

@RSchoesterIdyn

Description

@RSchoesterIdyn

Describe the issue

A regular decimal field in our extension no longer accepts more decimal places than setup in the General Ledger Setup for Amounts. This used to work in previous BC versions, so it's a breaking change.

This is how the field is defined in our extension:
image
(no decimal places setup and no AutoFormatType)

This is the error we get when we try to enter more positions than the Amount Unit Precision allows in the General Ledger Setup:
image

When I change the Amount Decimal Places to 2:5 in the General Ledger Setup (and I refresh the session), then the same value is accepted.

Expected behavior

The Decimal Places for Amounts and Unit Amounts should only be applied to decimal fields with a corresponding AutoFormatType.

Steps to reproduce

This issue seems to apply to all our decimal fields in all our extensions.
So, reproduction should be quite straightforward:

  1. Create a new decimal field in an extension.
    This decimal field should not have any properties except a caption and a dataclassification.
  2. Add the decimal field to a page.
    Set the ApplicationArea and a Tooltip.
  3. Publish the extension
  4. Verify that the Amount Decimal Places are set to 2:2 in the General Ledger Setup.
  5. Enter a decimal with more than 2 decimal places (0.0001).

Additional context

We do have a workaround, but it requires that we explicitly set the decimal places for the decimal fields.

We have seen this behavior in Version: NL Business Central 23.1 (Platform 23.0.13763.0 + Application 23.1.13431.13546)
But also in the latest builds of BC22

There is also something off with the error message as it doesn't give the option to copy the call stack, which is the new behavior in BC23.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions