web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Bug: Standard fields of type Code don't sort properly when you use number codes

(0) ShareShare
ReportReport
Posted on by

Seems that in BC SaaS v20.0.ES standard fields of type Code don't sort properly when you use number codes.

We have needed to cut the numbering of the Sales Orders "No." and this is the result now when sorting by the PK the Sales Orders List.

pastedimage1651914245563v1.png

I think this is a global standard Bug...

Could someone report it to Microsoft?

NOTE.- The chosen numbering has not depended on me and it is too late to change it...

I have the same question (0)
  • Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    Hi,

    This is not a bug. This is the designed behavior of a code field.

    A code field is basically a text field and numeric values entered into a code field is sorted as they would be text values.

    This is why you see this sorting behavior for a code field.

    Letters entered into a code field is always turned into capital letters. That is also a behavior of a code field.

  • JFuentes Profile Picture
    on at

    Hi NorthW ,

    I'm sorry to disagree with your opinion about this is not a Bug of standard BC...

    If you know old Navision versions running over "native" database engine, Code fields sort like numbers when all registers have numbers in this fields... by desing, not only convert to capital letters.

    When Navision started support running over MS SQL Server database engine, on migration projects this was an issue that MS solved adding the "SQL Data Type" property to fields and saying developers that we should set the Variant value to this property of all the standard and non-standard fields we needed...

    pastedimage1652006780792v1.png

    With Navison and (and BC OnPrem) developers can modify this property over standard fields, but with BC SaaS infraestructure this is not possible, so I think Microsoft should set "SQL Data Type" = Variant by default in all standard Code fields to retrieve the full native behaviour of Code datatype fields or allow customize this property in tableextension objects.

    pastedimage1652009124202v2.png

  • Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    I think you have two options.

    Either submit it as a product idea on https://experience.dynamics.com/ideas/ or if you really think it is a bug you should report it through your CSP partner.

  • YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at

    Hi, as Inge said, this is not a bug.

    But this is really a problem, I understand your idea very well. I have experienced that customer want to move line up and down before, because normal sorting cannot satisfy them..

    This may not be the same page, but in this case, you can create a new field and reorder by the new field.....Of course this is cumbersome, and developers are generally reluctant to do it.

    A simple example: https://yzhums.com/13671/

    Hope this helps.

    Thanks.

    ZHU

  • JFuentes Profile Picture
    on at

    Thanks yzhums ,

    I think your solution is very interesting, but is not valid for this scenario because every new sales order should be sorted before the existing ones that were created with one more digit in its primary key...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans