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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

ID Range Problem for Aggregate Extension

(0) ShareShare
ReportReport
Posted on by 66

Dear all,

i have created a table extension for the purchase inv line aggregate. Here I simply return more standard table fields (63 64).

This works fine in my sandbox. When I now use the application in a tenant Saas BC the extension validation fails with:

(6,19): error PTE0002: Field 'Receipt No.' has an ID of [63. It must be between within the range '[50000..99999'.

But if i change the field id to the range 50000... the field is not picked up correctly anymore from the original table.

How can I map the table field id 63 to my needed range 50000..99999?

Thanks in advance.

tableextension 50120 "EX Purch. Inv. Line Aggregate" extends "Purch. Inv. Line Aggregate"
{
    fields
    {

        field(63; "Receipt No."; Code[20])
        {
            Caption = 'Receipt No.';
            Editable = false;
        }
        field(64; "Receipt Line No."; Integer)
        {
            Caption = 'Receipt Line No.';
            Editable = false;
        }
        field(65; "Order No."; Code[20])
        {
            Caption = 'Order No.';
        }
        field(66; "Order Line No."; Integer)
        {
            Caption = 'Order Line No.';
        }
        field(5791; "Promised Receipt Date"; Date)
        {
            AccessByPermission = TableData "Order Promising Line" = R;
            Caption = 'Promised Receipt Date';
        }
    }
}

I have the same question (0)
  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    If you want to modify the behavior of an existing field you need to add a modify{yourfield} section in your code. If you do not do that AL will think you want to add a new field in the table.

  • SvenB Profile Picture
    66 on at

    Dear Inge,

    thanks for the help!

    I now added the "modify" statement. But in the modify input the correct field "Receipt No." is not recognized, as it is not yet defined on the table "Purch. Inv. Line Aggregate", but only on the "Purch.Inv. Line" Table.

    E.g.

    modify( "Receipt No.)

    {}

    -> The field '"Receipt No."' is not found in the target 'Purch. Inv. Line Aggregate'

  • Verified answer
    YUN ZHU Profile Picture
    102,765 Super User 2026 Season 2 on at

    Hi, I'm not clear about your purpose, as Igne said, if you want to modify a field, please use Modify, if you want to add a new field, please use the range of 50000~99999. Because this is a TableExtension not a new table, 0-49,999 is assigned to Business Central base app functionality and must not be used in extensions or customizations.

    Then as you mentioned, the field '"Receipt No."' is not found in table 5478 "Purch. Inv. Line Aggregate", you should use the range of 50000~99999 to add new fields, instead of the standard ID fields, which may be different from NAV.

    pastedimage1643072631117v1.png

    Hope this will help.

    Thanks.

    ZHU

  • SvenB Profile Picture
    66 on at

    Hi ZHU YUN,

    thanks for the help. My problem ist the following: As soon as I change the field number from 63 to the range 50000-99999 I do not receive the actual entry from the Purch. Inv. Line table.

    So in below example I return both fields in my API Page, but only get a result for the first field (with ID 63) but not for my own custom field (with ID 65063).

    How do I have to change the table extension field, to return the Receipt No. from the Purch. Inv. Line in the custom field within the correct range?

    Thanks

    Bildschirmfoto-2022_2D00_01_2D00_25-um-10.53.22.png

  • SvenB Profile Picture
    66 on at

    I have not figured out how to make this work with the aggregate page and therefore moved away from extending the V2 pages. Now I am using the standard pages and it works fine.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 524 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 399 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 354 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans