Announcements
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 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.
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
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.
Hope this will help.
Thanks.
ZHU
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'
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.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156